From 4aeb3ff63d31edd070ced439ffbae79d9a938492 Mon Sep 17 00:00:00 2001 From: T00thpick1 Date: Mon, 5 Aug 2013 23:29:01 -0500 Subject: [PATCH] Call unleash event for non-sitting animals. Fixes BUKKIT-4658 The unleash event is only called for animals that are sitting - ones that receive no movement vector. This adds the missing event call for non-sitting animals. --- src/main/java/net/minecraft/server/EntityCreature.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index c2f63c4c95..44b6024645 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -5,6 +5,7 @@ import java.util.UUID; // CraftBukkit start import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityUnleashEvent; // CraftBukkit end public abstract class EntityCreature extends EntityInsentient { @@ -264,7 +265,7 @@ public abstract class EntityCreature extends EntityInsentient { if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) { if (f > 10.0F) { - this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.a(true, true); } @@ -293,6 +294,7 @@ public abstract class EntityCreature extends EntityInsentient { } if (f > 10.0F) { + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.a(true, true); } } else if (!this.bH() && this.bt) {