13
0
geforkt von Mirrors/Paper

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.
Dieser Commit ist enthalten in:
T00thpick1 2013-08-05 23:29:01 -05:00 committet von Wesley Wolfe
Ursprung e489840ca9
Commit 4aeb3ff63d

Datei anzeigen

@ -5,6 +5,7 @@ import java.util.UUID;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.EntityUnleashEvent;
// CraftBukkit end // CraftBukkit end
public abstract class EntityCreature extends EntityInsentient { public abstract class EntityCreature extends EntityInsentient {
@ -264,7 +265,7 @@ public abstract class EntityCreature extends EntityInsentient {
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) { if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
if (f > 10.0F) { 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); this.a(true, true);
} }
@ -293,6 +294,7 @@ public abstract class EntityCreature extends EntityInsentient {
} }
if (f > 10.0F) { if (f > 10.0F) {
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
this.a(true, true); this.a(true, true);
} }
} else if (!this.bH() && this.bt) { } else if (!this.bH() && this.bt) {