diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/EntityCreature.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/entity/EntityCreature.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/EntityCreature.patch b/patch-remap/og/net/minecraft/world/entity/EntityCreature.patch new file mode 100644 index 0000000000..0af2eb0e05 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/entity/EntityCreature.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/world/entity/EntityCreature.java ++++ b/net/minecraft/world/entity/EntityCreature.java +@@ -9,6 +9,10 @@ + import net.minecraft.world.level.World; + import net.minecraft.world.phys.Vec3D; + ++// CraftBukkit start ++import org.bukkit.event.entity.EntityUnleashEvent; ++// CraftBukkit end ++ + public abstract class EntityCreature extends EntityInsentient { + + protected static final float DEFAULT_WALK_TARGET_VALUE = 0.0F; +@@ -51,6 +55,7 @@ + + if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isInSittingPose()) { + if (f > 10.0F) { ++ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + this.dropLeash(true, true); + } + +@@ -59,6 +64,7 @@ + + this.onLeashDistance(f); + if (f > 10.0F) { ++ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + this.dropLeash(true, true); + this.goalSelector.disableControlFlag(PathfinderGoal.Type.MOVE); + } else if (f > 6.0F) { |