Skip to content

Commit

Permalink
Fixes a bug that removed old owner from island
Browse files Browse the repository at this point in the history
These changes fix a bug that was introduced by clearing the island cache from the old owner for 2.0 verison.

This will set the previous owner as sub-owner on the island.
  • Loading branch information
BONNe authored Oct 29, 2023
1 parent 4a6bf31 commit 53522e8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,10 @@ public void setOwner(World world, User user, UUID targetUUID) {
*/
public void setOwner(User user, UUID targetUUID, Island island) {
islandCache.setOwner(island, targetUUID);
// Remove the old owner from the island
// Remove the old owner from the island to clear cache
plugin.getIslands().removePlayer(island, user.getUniqueId());
// Set old owner as sub-owner on island.
island.setRank(user, RanksManager.SUB_OWNER_RANK);

user.sendMessage("commands.island.team.setowner.name-is-the-owner", "[name]", plugin.getPlayers().getName(targetUUID));
plugin.getIWM().getAddon(island.getWorld()).ifPresent(addon -> {
Expand Down

0 comments on commit 53522e8

Please sign in to comment.