mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
default commands no longer check permission
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user