From 3c3c6cc5f1bba266e3a36c185807f421028d48c5 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 28 Jul 2012 16:22:03 +0800 Subject: [PATCH] Use custom spawn reason --- src/main/java/net/citizensnpcs/npc/CitizensNPC.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index b0cbcd829..912127443 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -18,6 +18,7 @@ import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.metadata.FixedMetadataValue; public abstract class CitizensNPC extends AbstractNPC { @@ -124,7 +125,7 @@ public abstract class CitizensNPC extends AbstractNPC { mcEntity = createHandle(loc); - mcEntity.world.addEntity(mcEntity); + mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM); mcEntity.world.players.remove(mcEntity); getBukkitEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true));