Skip to content

Commit a1ab87a

Browse files
authored
Merge pull request #2680 from BentoBoxWorld/2679_Box_gets_reused_even_though_it_should_not
2679 box gets reused even though it should not
2 parents 8e90c15 + 7beecd0 commit a1ab87a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<!-- Do not change unless you want different name for local builds. -->
7575
<build.number>-LOCAL</build.number>
7676
<!-- This allows to change between versions. -->
77-
<build.version>3.3.5</build.version>
77+
<build.version>3.4.0</build.version>
7878
<sonar.organization>bentobox-world</sonar.organization>
7979
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
8080
<server.jars>${project.basedir}/lib</server.jars>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,24 +284,24 @@ public void deleteIsland(@NonNull Island island, boolean removeBlocks, @Nullable
284284
// Set the owner of the island to no one.
285285
island.setOwner(null);
286286
island.setFlag(Flags.LOCK, RanksManager.VISITOR_RANK);
287-
island.setDeleted(true);
288287
if (removeBlocks) {
289-
// Remove island from the cache
290-
islandCache.deleteIslandFromCache(island);
291288
// Remove players from island
292289
removePlayersFromIsland(island);
293290
if (!plugin.getSettings().isKeepPreviousIslandOnReset()) {
291+
island.setDeleted(true);
292+
// Remove island from the cache
293+
islandCache.deleteIslandFromCache(island);
294294
// Remove blocks from world
295295
IslandDeletion id = new IslandDeletion(island);
296296
plugin.getIslandDeletionManager().getIslandChunkDeletionManager().add(id);
297297
// Tell other servers
298298
MultiLib.notify("bentobox-deleteIsland", getGson().toJson(id));
299+
// Delete the island from the database
300+
handler.deleteObject(island);
299301
} else {
300302
// Fire the deletion event immediately
301303
IslandEvent.builder().deletedIslandInfo(new IslandDeletion(island)).reason(Reason.DELETED).build();
302304
}
303-
// Delete the island from the database
304-
handler.deleteObject(island);
305305
}
306306
}
307307

0 commit comments

Comments
 (0)