Fix group list priority

master
Etzelia 2018-09-15 17:25:44 -05:00
parent b30543ffea
commit e548133044
1 changed files with 4 additions and 1 deletions

View File

@ -24,11 +24,14 @@ public class ListCommand implements CommandExecutor {
Map<String, List<String>> list = new HashMap<>(); Map<String, List<String>> list = new HashMap<>();
List<String> groups = plugin.getConfig().getStringList("list"); List<String> groups = plugin.getConfig().getStringList("list");
for (String group : groups) {
list.put(group, new ArrayList<>());
}
for (Player player : Bukkit.getServer().getOnlinePlayers()) { for (Player player : Bukkit.getServer().getOnlinePlayers()) {
for (String group : groups) { for (String group : groups) {
if (player.hasPermission("qol.list." + group)) { if (player.hasPermission("qol.list." + group)) {
List<String> names = list.containsKey(group) ? list.get(group) : new ArrayList<String>(); List<String> names = list.get(group);
names.add(player.getName()); names.add(player.getName());
list.put(group, names); list.put(group, names);
break; break;