Only check island distances for known worlds.

BentoBox would refuse to start if islands from worlds unknown to the
server were in the database. e.g. a CaveBlock island where the CaveBlock
addon had been removed.
This commit is contained in:
tastybento 2020-09-06 15:31:30 -07:00
parent e9370b9a05
commit a6d1acf59d

View File

@ -1060,7 +1060,9 @@ public class IslandsManager {
// Add to quarantine cache
quarantineCache.computeIfAbsent(island.getOwner(), k -> new ArrayList<>()).add(island);
} // Check island distance and if incorrect stop BentoBox
else if (island.getRange() != plugin.getIWM().getIslandDistance(island.getWorld())) {
else if (island.getWorld() != null
&& plugin.getIWM().inWorld(island.getWorld())
&& island.getRange() != plugin.getIWM().getIslandDistance(island.getWorld())) {
throw new IOException("Island distance mismatch!\n"
+ "World '" + island.getWorld().getName() + "' distance " + plugin.getIWM().getIslandDistance(island.getWorld()) + " != island range " + island.getRange() + "!\n"
+ "Island ID in database is " + island.getUniqueId() + ".\n"