From 422313c23a5fc75e5021402b407f50a52448e4d2 Mon Sep 17 00:00:00 2001 From: aPunch Date: Fri, 23 Mar 2012 07:01:55 -0500 Subject: [PATCH] Fix NoSuchElementException on remove all --- src/main/java/net/citizensnpcs/NPCUpdater.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/citizensnpcs/NPCUpdater.java b/src/main/java/net/citizensnpcs/NPCUpdater.java index 2098b236a..b06a85fe4 100644 --- a/src/main/java/net/citizensnpcs/NPCUpdater.java +++ b/src/main/java/net/citizensnpcs/NPCUpdater.java @@ -4,6 +4,7 @@ import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPCManager; +// TODO: Move to Entity.update()? public class NPCUpdater implements Runnable { private final CitizensNPCManager npcManager; @@ -13,6 +14,8 @@ public class NPCUpdater implements Runnable { @Override public void run() { + if (!npcManager.iterator().hasNext()) + return; for (NPC npc : npcManager) { if (!npc.isSpawned()) continue;