diff options
author | PaulBGD <ultimate@burngames.net> | 2013-12-11 21:13:04 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-18 12:55:07 -0500 |
commit | 941650b9b2a727fb00164377bfd8b760d37e2806 (patch) | |
tree | 85831b7c55a1d163be38a13dd8f1715c21bda0f7 /src/main/java/org/bukkit | |
parent | 4c9bf34bf3f7954313dd6e5f8d8b208119c115ca (diff) | |
download | craftbukkit-941650b9b2a727fb00164377bfd8b760d37e2806.tar craftbukkit-941650b9b2a727fb00164377bfd8b760d37e2806.tar.gz craftbukkit-941650b9b2a727fb00164377bfd8b760d37e2806.tar.lz craftbukkit-941650b9b2a727fb00164377bfd8b760d37e2806.tar.xz craftbukkit-941650b9b2a727fb00164377bfd8b760d37e2806.zip |
Fix setting entity's target. Fixes BUKKIT-1358
Setting the goal target overrides the entity's will to do something
else. This makes it so entities like wolves with attack another player
with .setTarget(), instead of hanging next to their owner.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java index b9905dbb..a6c0b94e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java @@ -15,9 +15,11 @@ public class CraftCreature extends CraftLivingEntity implements Creature { EntityCreature entity = getHandle(); if (target == null) { entity.target = null; + entity.setGoalTarget(null); } else if (target instanceof CraftLivingEntity) { entity.target = ((CraftLivingEntity) target).getHandle(); entity.pathEntity = entity.world.findPath(entity, entity.target, 16.0F, true, false, false, true); + entity.setGoalTarget(((CraftLivingEntity) target).getHandle()); } } |