mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-26 19:17:40 +01:00
Fixes loading and setting of spawn island.
https://github.com/BentoBoxWorld/BentoBox/issues/523 When loading islands the spawn setting was not being checked so spawn islands were not added to the spawn island map.
This commit is contained in:
parent
ce0b9569ca
commit
564f60bab3
@ -680,7 +680,6 @@ public class IslandsManager {
|
||||
oldSpawn.setSpawn(false);
|
||||
}
|
||||
}
|
||||
|
||||
this.spawn.put(spawn.getWorld(), spawn);
|
||||
spawn.setSpawn(true);
|
||||
}
|
||||
@ -702,17 +701,19 @@ public class IslandsManager {
|
||||
// Only load non-quarantined island
|
||||
// TODO: write a purge admin command to delete these records
|
||||
handler.loadObjects().stream().filter(i -> !i.isDoNotLoad()).forEach(island -> {
|
||||
if (!islandCache.addIsland(island)) {
|
||||
// Quarantine the offending island
|
||||
toQuarantine.add(island);
|
||||
}
|
||||
if (!islandCache.addIsland(island)) {
|
||||
// Quarantine the offending island
|
||||
toQuarantine.add(island);
|
||||
} else if (island.isSpawn()) {
|
||||
this.setSpawn(island);
|
||||
}
|
||||
});
|
||||
if (!toQuarantine.isEmpty()) {
|
||||
plugin.logError(toQuarantine.size() + " islands could not be loaded successfully; quarantining.");
|
||||
toQuarantine.forEach(i -> {
|
||||
i.setDoNotLoad(true);
|
||||
handler.saveObject(i);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user