mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-20 06:12:38 +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.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.CitizensNPCManager;
|
import net.citizensnpcs.npc.CitizensNPCManager;
|
||||||
|
|
||||||
|
// TODO: Move to Entity.update()?
|
||||||
public class NPCUpdater implements Runnable {
|
public class NPCUpdater implements Runnable {
|
||||||
private final CitizensNPCManager npcManager;
|
private final CitizensNPCManager npcManager;
|
||||||
|
|
||||||
@ -13,6 +14,8 @@ public class NPCUpdater implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (!npcManager.iterator().hasNext())
|
||||||
|
return;
|
||||||
for (NPC npc : npcManager) {
|
for (NPC npc : npcManager) {
|
||||||
if (!npc.isSpawned())
|
if (!npc.isSpawned())
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user