mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-13 10:51:20 +01:00
Fixes a bug that removed old owner from island (#2218)
* Fixes a bug that removed old owner from island 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. * Fixes rank on event fired. Changes from Visitor to Sub owner rank * Update IslandsManager.java Removes line that removes player from cache. They should remain in the cache. --------- Co-authored-by: tastybento <tastybento@users.noreply.github.com>
This commit is contained in:
parent
4a6bf31dff
commit
4200fe4abb
@ -95,7 +95,7 @@ public class IslandTeamSetownerCommand extends CompositeCommand {
|
||||
.involvedPlayer(user.getUniqueId())
|
||||
.admin(false)
|
||||
.reason(IslandEvent.Reason.RANK_CHANGE)
|
||||
.rankChange(RanksManager.OWNER_RANK, RanksManager.VISITOR_RANK)
|
||||
.rankChange(RanksManager.OWNER_RANK, RanksManager.SUB_OWNER_RANK)
|
||||
.build();
|
||||
getIslands().save(island);
|
||||
return true;
|
||||
@ -107,4 +107,4 @@ public class IslandTeamSetownerCommand extends CompositeCommand {
|
||||
return Optional.of(Util.tabLimit(getIslands().getMembers(getWorld(), user.getUniqueId()).stream().map(getPlayers()::getName).toList(), lastArg));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1520,8 +1520,8 @@ public class IslandsManager {
|
||||
*/
|
||||
public void setOwner(User user, UUID targetUUID, Island island) {
|
||||
islandCache.setOwner(island, targetUUID);
|
||||
// Remove the old owner from the island
|
||||
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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user