Fixes bug where non-members could be made island owners.

This commit is contained in:
tastybento 2024-03-10 11:29:51 -07:00
parent 7f532b1257
commit 4170616e47
1 changed files with 2 additions and 1 deletions

View File

@ -520,7 +520,8 @@ public class IslandTeamCommand extends CompositeCommand {
case "SETOWNER" -> {
// Make the player the leader of the island
if (clickingUser.hasPermission(this.setOwnerCommand.getPermission()) && !target.equals(clickingUser)
&& clickingUser.getUniqueId().equals(island.getOwner())) {
&& clickingUser.getUniqueId().equals(island.getOwner())
&& island.getRank(target) >= RanksManager.MEMBER_RANK) {
getPlugin().log("Set Owner: " + clickingUser.getName() + " trying to make " + target.getName()
+ " owner of island at " + island.getCenter());
clickingUser.closeInventory();