mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-03-12 14:49:24 +01:00
Should fix CHM error in asyncSaveAll
https://github.com/BentoBoxWorld/BentoBox/issues/982
This commit is contained in:
parent
e9e10eed75
commit
7d8539b4cd
@ -985,14 +985,14 @@ public class IslandsManager {
|
||||
public void asyncSaveAll() {
|
||||
if (!toSave.isEmpty()) return;
|
||||
// Get a list of ID's to save
|
||||
toSave = islandCache.getAllIslandIds();
|
||||
toSave = new HashSet<>(islandCache.getAllIslandIds());
|
||||
it = toSave.iterator();
|
||||
task = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
|
||||
if (plugin.isEnabled() && it.hasNext()) {
|
||||
getIslandById(it.next()).ifPresent(this::save);
|
||||
} else {
|
||||
toSave.clear();
|
||||
task.cancel();
|
||||
toSave.clear();
|
||||
task.cancel();
|
||||
}
|
||||
}, 0L, 1L);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user