default commands no longer check permission

This commit is contained in:
YouHaveTrouble
2020-12-15 22:10:01 +01:00
parent c135815ce3
commit 2a93f8c636
@@ -13,9 +13,10 @@ public class CommandsList {
public static List<String> getCommands(Player player) { public static List<String> getCommands(Player player) {
List<String> commandList = new ArrayList<>(); List<String> commandList = new ArrayList<>();
for (Map.Entry<String, List<String>> s : CommandWhitelist.getConfigCache().getPermList().entrySet()) { for (Map.Entry<String, List<String>> s : CommandWhitelist.getConfigCache().getPermList().entrySet()) {
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) { if (s.getKey().equalsIgnoreCase("default"))
commandList.addAll(s.getValue()); commandList.addAll(s.getValue());
} else if (player.hasPermission("commandwhitelist.commands." + s.getKey()))
commandList.addAll(s.getValue());
} }
return commandList; return commandList;
} }
@@ -23,9 +24,10 @@ public class CommandsList {
public static List<String> getCommands(ProxiedPlayer player) { public static List<String> getCommands(ProxiedPlayer player) {
List<String> commandList = new ArrayList<>(); List<String> commandList = new ArrayList<>();
for (Map.Entry<String, List<String>> s : CommandWhitelistBungee.getConfigCache().getPermList().entrySet()) { for (Map.Entry<String, List<String>> s : CommandWhitelistBungee.getConfigCache().getPermList().entrySet()) {
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) { if (s.getKey().equalsIgnoreCase("default"))
commandList.addAll(s.getValue());
else if (player.hasPermission("commandwhitelist.commands." + s.getKey()))
commandList.addAll(s.getValue()); commandList.addAll(s.getValue());
}
} }
return commandList; return commandList;
} }