Show regions user is member of, as well as those user is owner of.

This commit is contained in:
Moo0 2011-05-08 18:55:48 +01:00
parent 763cf8dbda
commit 943bbd9889

View File

@ -484,8 +484,11 @@ public static void list(CommandContext args, WorldGuardPlugin plugin,
String[] regionIDList = new String[size];
int index = 0;
boolean show = false;
String prefix = "";
for (String id : regions.keySet()) {
boolean show = false;
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]);
}
}
}