From e968096fc72e80731405d7f5d48848e43a94d1c1 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 7 Jan 2011 14:06:08 -0800 Subject: [PATCH] Changed resolution order in CraftWorld.toCraftEntity() to give CraftMappable precedence. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index fb6d67f6ff..fdfcaea5d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -166,7 +166,9 @@ public class CraftWorld implements World { } public CraftEntity toCraftEntity(net.minecraft.server.Entity entity) { - if (entity instanceof EntityArrow) { + if (entity instanceof CraftMappable) { + return ((CraftMappable)entity).getCraftEntity(); + } else if (entity instanceof EntityArrow) { return new CraftArrow(world.getServer(), (EntityArrow)entity); } else if (entity instanceof EntityEgg) { return new CraftEgg(world.getServer(), (EntityEgg)entity); @@ -178,8 +180,6 @@ public class CraftWorld implements World { return new CraftHumanEntity(world.getServer(), (EntityPlayer)entity); } else if (entity instanceof EntityLiving) { return new CraftLivingEntity(world.getServer(), (EntityLiving)entity); - } else if (entity instanceof CraftMappable) { - return ((CraftMappable)entity).getCraftEntity(); } else { return null; }