Skip to content

Commit 53f6f91

Browse files
committed
Improve deletion marking and saving of islands.
1 parent 79fb132 commit 53f6f91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/world/bentobox/bentobox/managers/IslandsManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ public void deleteIsland(@NonNull Island island, boolean removeBlocks, @Nullable
287287
if (removeBlocks) {
288288
// Remove players from island
289289
removePlayersFromIsland(island);
290-
if (!plugin.getSettings().isKeepPreviousIslandOnReset()) {
291-
island.setDeleted(true);
290+
// Mark island as deleted
291+
island.setDeleted(true);
292+
if (!plugin.getSettings().isKeepPreviousIslandOnReset()) {
292293
// Remove island from the cache
293294
islandCache.deleteIslandFromCache(island);
294295
// Remove blocks from world
@@ -299,6 +300,7 @@ public void deleteIsland(@NonNull Island island, boolean removeBlocks, @Nullable
299300
// Delete the island from the database
300301
handler.deleteObject(island);
301302
} else {
303+
handler.saveObject(island);
302304
// Fire the deletion event immediately
303305
IslandEvent.builder().deletedIslandInfo(new IslandDeletion(island)).reason(Reason.DELETED).build();
304306
}

0 commit comments

Comments
 (0)