diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/ItemBasedSteering.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/ItemBasedSteering.java.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/ItemBasedSteering.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/ItemBasedSteering.java.patch new file mode 100644 index 0000000000..10c4c3615c --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/ItemBasedSteering.java.patch @@ -0,0 +1,76 @@ +--- a/net/minecraft/world/entity/ItemBasedSteering.java ++++ b/net/minecraft/world/entity/ItemBasedSteering.java +@@ -13,13 +13,13 @@ + private final SynchedEntityData entityData; + private final EntityDataAccessor<Integer> boostTimeAccessor; + private final EntityDataAccessor<Boolean> hasSaddleAccessor; +- private boolean boosting; +- private int boostTime; ++ public boolean boosting; ++ public int boostTime; + +- public ItemBasedSteering(SynchedEntityData synchedentitydata, EntityDataAccessor<Integer> entitydataaccessor, EntityDataAccessor<Boolean> entitydataaccessor1) { +- this.entityData = synchedentitydata; +- this.boostTimeAccessor = entitydataaccessor; +- this.hasSaddleAccessor = entitydataaccessor1; ++ public ItemBasedSteering(SynchedEntityData entityData, EntityDataAccessor<Integer> boostTimeAccessor, EntityDataAccessor<Boolean> hasSaddleAccessor) { ++ this.entityData = entityData; ++ this.boostTimeAccessor = boostTimeAccessor; ++ this.hasSaddleAccessor = hasSaddleAccessor; + } + + public void onSynced() { +@@ -27,13 +27,13 @@ + this.boostTime = 0; + } + +- public boolean boost(RandomSource randomsource) { ++ public boolean boost(RandomSource random) { + if (this.boosting) { + return false; + } else { + this.boosting = true; + this.boostTime = 0; +- this.entityData.set(this.boostTimeAccessor, randomsource.nextInt(841) + 140); ++ this.entityData.set(this.boostTimeAccessor, random.nextInt(841) + 140); + return true; + } + } +@@ -49,22 +49,30 @@ + return this.boosting ? 1.0F + 1.15F * Mth.sin((float) this.boostTime / (float) this.boostTimeTotal() * 3.1415927F) : 1.0F; + } + +- private int boostTimeTotal() { ++ public int boostTimeTotal() { + return (Integer) this.entityData.get(this.boostTimeAccessor); + } + +- public void addAdditionalSaveData(CompoundTag compoundtag) { +- compoundtag.putBoolean("Saddle", this.hasSaddle()); ++ // CraftBukkit add setBoostTicks(int) ++ public void setBoostTicks(int ticks) { ++ this.boosting = true; ++ this.boostTime = 0; ++ this.entityData.set(this.boostTimeAccessor, ticks); + } ++ // CraftBukkit end + +- public void readAdditionalSaveData(CompoundTag compoundtag) { +- this.setSaddle(compoundtag.getBoolean("Saddle")); ++ public void addAdditionalSaveData(CompoundTag nbt) { ++ nbt.putBoolean("Saddle", this.hasSaddle()); + } + +- public void setSaddle(boolean flag) { +- this.entityData.set(this.hasSaddleAccessor, flag); ++ public void readAdditionalSaveData(CompoundTag nbt) { ++ this.setSaddle(nbt.getBoolean("Saddle")); + } + ++ public void setSaddle(boolean saddled) { ++ this.entityData.set(this.hasSaddleAccessor, saddled); ++ } ++ + public boolean hasSaddle() { + return (Boolean) this.entityData.get(this.hasSaddleAccessor); + } |