Track Metropolis home ownership by UUID

This commit is contained in:
2026-09-26 22:46:12 -07:00
parent 509df1b452
commit 81b34862b4
6 changed files with 151 additions and 79 deletions

View File

@@ -34,15 +34,15 @@ public class MetropolisHomeEvictCommand implements CommandExecutor {
return false;
}
ProtectedRegion region = _plugin.getRegion(String.format("h_%s", player.getName()));
ProtectedRegion region = _plugin.getRegion(_plugin.getCurrentHomeRegionName(player.getUniqueId()));
if(region == null){
sender.sendMessage(String.format("The player {%s} has no home to be evicted from."));
return false;
}
//remove the player as owner and/or member of the region
region.getMembers().removePlayer(playerName);
region.getOwners().removePlayer(playerName);
region.getMembers().removePlayer(player.getUniqueId());
region.getOwners().removePlayer(player.getUniqueId());
//if the region has no owners delete the region
if(region.getMembers().size() == 0 && region.getOwners().size() == 0){