Archived
0

Fixed ConcurrentModificationException

This commit is contained in:
Pepich
2018-03-12 03:26:08 +01:00
parent 410493b1ae
commit 452b738e2d

View File

@@ -36,7 +36,7 @@ import com.redstoner.modules.Module;
@Commands(CommandHolderType.Stream) @Commands(CommandHolderType.Stream)
@AutoRegisterListener @AutoRegisterListener
@Version(major = 4, minor = 1, revision = 7, compatible = 4) @Version(major = 4, minor = 1, revision = 8, compatible = 4)
public final class DataManager implements CoreModule, Listener public final class DataManager implements CoreModule, Listener
{ {
protected final File dataFolder = new File(Main.plugin.getDataFolder(), "data"); protected final File dataFolder = new File(Main.plugin.getDataFolder(), "data");
@@ -86,13 +86,13 @@ public final class DataManager implements CoreModule, Listener
{ {
for (String id : scheduled_saves) for (String id : scheduled_saves)
{ {
scheduled_saves.remove(id);
Object raw = data.get(id); Object raw = data.get(id);
if (raw == null || ((JSONObject) raw).size() == 0) if (raw == null || ((JSONObject) raw).size() == 0)
return; continue;
JSONObject json = (JSONObject) raw; JSONObject json = (JSONObject) raw;
JsonManager.save(json, new File(dataFolder, id + ".json")); JsonManager.save(json, new File(dataFolder, id + ".json"));
} }
scheduled_saves.clear();
} }
}, 0, 20).getTaskId(); }, 0, 20).getTaskId();
} }