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.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
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
|
// Don't bother with this part if MC versions are not compatible
|
||||||
if (compatible) {
|
if (compatible) {
|
||||||
save();
|
save();
|
||||||
Iterator<NPC> itr = npcManager.iterator();
|
while (npcManager.iterator().hasNext()) {
|
||||||
while (itr.hasNext()) {
|
npcManager.iterator().next().despawn();
|
||||||
itr.next().despawn();
|
npcManager.iterator().remove();
|
||||||
itr.remove();
|
|
||||||
}
|
}
|
||||||
npcManager = null;
|
npcManager = null;
|
||||||
getServer().getScheduler().cancelTasks(this);
|
getServer().getScheduler().cancelTasks(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user