Fix group list priority
parent
b30543ffea
commit
e548133044
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue