From a975b9ebf5f5c6b37d35357e8b94b42b4471bcd0 Mon Sep 17 00:00:00 2001 From: fullwall Date: Tue, 24 Apr 2012 13:31:52 +0800 Subject: [PATCH] Ignore non-living entities --- src/main/java/net/citizensnpcs/npc/CitizensNPCManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPCManager.java b/src/main/java/net/citizensnpcs/npc/CitizensNPCManager.java index 9ab533152..e91ee2f5e 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPCManager.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPCManager.java @@ -21,6 +21,7 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; @@ -71,6 +72,8 @@ public class CitizensNPCManager implements NPCManager { @Override public NPC getNPC(Entity entity) { + if (!(entity instanceof LivingEntity)) + return null; net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle(); if (handle instanceof NPCHandle) return ((NPCHandle) handle).getNPC();