Fix deletion of islands when chunks are not deleted. Fixes #2241

This commit is contained in:
tastybento 2023-12-03 19:50:51 -08:00
parent f256c3af8d
commit 22f398fe53
2 changed files with 268 additions and 266 deletions

View File

@ -271,10 +271,12 @@ public class IslandsManager {
handler.deleteObject(island);
// Remove players from island
removePlayersFromIsland(island);
if (!plugin.getSettings().isKeepPreviousIslandOnReset()) {
// Remove blocks from world
plugin.getIslandDeletionManager().getIslandChunkDeletionManager().add(new IslandDeletion(island));
}
}
}
/**
* Get the number of islands made on this server. Used by stats.

View File

@ -312,7 +312,7 @@ public class NewIsland {
private void tidyUp(Island oldIsland) {
// Delete old island
if (oldIsland != null && !plugin.getSettings().isKeepPreviousIslandOnReset()) {
if (oldIsland != null) {
// Delete the old island
plugin.getIslands().deleteIsland(oldIsland, true, user.getUniqueId());
}