diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index 26c8c7e978..c867b32caa 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -13,8 +13,8 @@ import org.bukkit.event.entity.EntityTargetEvent.TargetReason; public class EntityCreature extends EntityLiving { - private PathEntity a; - protected Entity d; + public PathEntity a; // Craftbukkit - public + public Entity d; // Craftbukkit - public protected boolean e = false; public EntityCreature(World world) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java index 24b8b22761..09e15c13db 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java @@ -1,18 +1,36 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityCreature; +import net.minecraft.server.EntityLiving; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Creature; +import org.bukkit.entity.LivingEntity; public class CraftCreature extends CraftLivingEntity implements Creature{ + private EntityCreature entity; public CraftCreature(CraftServer server, EntityCreature entity) { super(server, entity); + this.entity = entity; + } + + public void setTarget(LivingEntity target) { + if (target == null) { + entity.d = null; + } else if (target instanceof CraftLivingEntity) { + EntityLiving victim = ((CraftLivingEntity)target).getHandle(); + entity.d = victim; + entity.a = entity.world.a(entity, entity.d, 16.0F); + } + } + + @Override + public EntityCreature getHandle() { + return entity; } @Override public String toString() { return "CraftCreature"; } - }