Skip to content

Commit

Permalink
Change utils for owners
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Jul 1, 2023
1 parent 41ced77 commit 34dabc6
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,23 +254,14 @@ public String getRegionOwnerList(String regionName, World w) {
return output.toString();
}

public boolean addOwners(String regionName, World w, Set<String> owners) {
public boolean addOwners(String regionName, World w, Set<UUID> owners) {
ProtectedRegion r = getRegion(regionName, w);
if (r == null)
return false;

DefaultDomain regionOwners = r.getOwners();

for (String ownerName : owners) {
if (ownerName.length() > 16) {
regionOwners.addPlayer(UUID.fromString(ownerName));
} else {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(ownerName);
if (offlinePlayer == null)
continue;

regionOwners.addPlayer(offlinePlayer.getUniqueId());
}
for (UUID owner : owners) {
regionOwners.addPlayer(owner);
}
return true;
}
Expand Down

0 comments on commit 34dabc6

Please sign in to comment.