mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 19:16:34 +01:00
Fixed NoSuchElementException on disable.
This commit is contained in:
parent
15c1ad24ad
commit
dcf81236df
@ -3,7 +3,6 @@ package net.citizensnpcs;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
@ -119,10 +118,9 @@ public class Citizens extends JavaPlugin {
|
||||
// Don't bother with this part if MC versions are not compatible
|
||||
if (compatible) {
|
||||
save();
|
||||
Iterator<NPC> itr = npcManager.iterator();
|
||||
while (itr.hasNext()) {
|
||||
itr.next().despawn();
|
||||
itr.remove();
|
||||
while (npcManager.iterator().hasNext()) {
|
||||
npcManager.iterator().next().despawn();
|
||||
npcManager.iterator().remove();
|
||||
}
|
||||
npcManager = null;
|
||||
getServer().getScheduler().cancelTasks(this);
|
||||
|
Loading…
Reference in New Issue
Block a user