forked from Minecraft/QoL
Fix group list priority
parent
b30543ffea
commit
e548133044
|
@ -24,11 +24,14 @@ public class ListCommand implements CommandExecutor {
|
|||
|
||||
Map<String, List<String>> list = new HashMap<>();
|
||||
List<String> groups = plugin.getConfig().getStringList("list");
|
||||
for (String group : groups) {
|
||||
list.put(group, new ArrayList<>());
|
||||
}
|
||||
|
||||
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
|
||||
for (String group : groups) {
|
||||
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());
|
||||
list.put(group, names);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue