Work around some plugins not extending from CraftEntity

This commit is contained in:
fullwall 2012-10-12 11:52:48 +08:00
parent fb068c593f
commit 414c82d78f

View File

@ -143,7 +143,7 @@ public class CitizensNPCRegistry implements NPCRegistry {
@Override
public NPC getNPC(Entity entity) {
if (entity == null)
if (entity == null || !(entity instanceof CraftEntity))
return null;
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
return handle != null && handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;