Fix soft-deleted islands still counting towards a player's islands - #3086
Merged
tastybento merged 2 commits intoSep 25, 2026
Merged
tastybento merged 2 commits into
tastybento merged 2 commits into
Conversation
Deleting an island (reset or /obadmin delete) cleared its owner but left it in the per-player UUID cache index. Until the next restart the island still counted towards the ex-owner's concurrent islands and was returned by getIslands(world, uuid). This blocked island transfers with the "already owns N islands" error, even though /obadmin delete said the player had no island. Drop the island from the UUID index when it is soft-deleted. It stays cached and in the grid so the region purge can still find and reap it.
tastybento
self-requested a review
September 25, 2026 07:38
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When an island is deleted (island reset or /obadmin delete), BentoBox only
clears the owner. The island is still left in the in-memory per-player UUID
index (islandsByUUID) until the server restarts.
Because of that:
admin can't transfer an island to the ex-owner ("player already owns N
islands").
hasIsland() does not, so /obadmin delete says the player has no island.
are only removed on shutdown.
On startup this is not a problem because addIsland() only indexes owned
islands, which is why a restart "fixes" it.
Fix
Add IslandCache#removeIslandFromUUIDIndex() and call it from
IslandsManager#deleteIsland() right after the owner is cleared. The island
is removed from every player's index, but kept in islandsById and the grid
so its location stays reserved and the region purge can still reap it.
Tests