mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-28 05:35:45 +01:00
Fix NoSuchElementException on remove all
This commit is contained in:
parent
6d95c73f5c
commit
422313c23a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user