From c8415740dc6b85935aed2e0b10f7e008188dc980 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();