Fixed UtilEnt.Leash method.

This commit is contained in:
Jonathan Williams 2015-11-11 04:36:10 -06:00
parent 0e6146d5c9
commit 27ef2c0bbb
1 changed files with 6 additions and 3 deletions

View File

@ -78,10 +78,13 @@ public class UtilEnt
public static void Leash(LivingEntity leashed, Entity holder, boolean pull, boolean breakable) public static void Leash(LivingEntity leashed, Entity holder, boolean pull, boolean breakable)
{ {
leashed.setPullWhileLeashed(pull);
leashed.setShouldBreakLeash(breakable);
leashed.setLeashHolder(holder); leashed.setLeashHolder(holder);
if (!(((CraftLivingEntity)leashed).getHandle() instanceof EntityInsentient))
return;
((EntityInsentient)((CraftLivingEntity)leashed).getHandle()).setPullWhileLeashed(pull);
((EntityInsentient)((CraftLivingEntity)leashed).getHandle()).setShouldBreakLeash(breakable);
} }
public static void addLookAtPlayerAI(Entity entity, float dist) public static void addLookAtPlayerAI(Entity entity, float dist)