mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 10:37:41 +01:00
Show regions user is member of, as well as those user is owner of.
This commit is contained in:
parent
763cf8dbda
commit
943bbd9889
@ -484,8 +484,11 @@ public static void list(CommandContext args, WorldGuardPlugin plugin,
|
||||
|
||||
String[] regionIDList = new String[size];
|
||||
int index = 0;
|
||||
for (String id : regions.keySet()) {
|
||||
boolean show = false;
|
||||
String prefix = "";
|
||||
for (String id : regions.keySet()) {
|
||||
show = false;
|
||||
prefix = "";
|
||||
if (name.isEmpty()) {
|
||||
show = true;
|
||||
}
|
||||
@ -493,15 +496,26 @@ public static void list(CommandContext args, WorldGuardPlugin plugin,
|
||||
if (own) {
|
||||
if (regions.get(id).isOwner(localPlayer)) {
|
||||
show = true;
|
||||
prefix += "+";
|
||||
}
|
||||
else if (regions.get(id).isMember(localPlayer)) {
|
||||
show = true;
|
||||
prefix += "-";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (regions.get(id).getOwners().getPlayers().contains(name))
|
||||
if (regions.get(id).getOwners().getPlayers().contains(name)) {
|
||||
show = true;
|
||||
prefix += "+";
|
||||
}
|
||||
if (regions.get(id).getMembers().getPlayers().contains(name)) {
|
||||
show = true;
|
||||
prefix += "-";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (show) {
|
||||
regionIDList[index] = id;
|
||||
regionIDList[index] = prefix + " " + id;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@ -521,7 +535,7 @@ public static void list(CommandContext args, WorldGuardPlugin plugin,
|
||||
break;
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW.toString() + (i + 1) +
|
||||
". " + regionIDList[i]);
|
||||
"." + regionIDList[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user