From e3c6103ec787b2cd47b6d654afe2e3c7a204bee4 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sun, 14 Jul 2024 14:19:55 +0200 Subject: [PATCH] the permission was flipped all those years... --- .../commandwhitelist/bukkit/CommandWhitelistBukkit.java | 2 +- .../commandwhitelist/velocity/CommandWhitelistVelocity.java | 5 +++-- .../waterfall/CommandWhitelistWaterfall.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java b/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java index 9577e20..ec2a89f 100644 --- a/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java +++ b/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java @@ -128,7 +128,7 @@ public static HashSet getSuggestions(org.bukkit.entity.Player player) { for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) suggestionList.addAll(s.getValue().getSubCommands()); - if (player.hasPermission(s.getValue().getPermission())) continue; + if (!player.hasPermission(s.getValue().getPermission())) continue; suggestionList.addAll(s.getValue().getSubCommands()); } return suggestionList; diff --git a/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java b/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java index 6e79e97..acf6c5e 100644 --- a/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java +++ b/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java @@ -127,12 +127,13 @@ else if (player.hasPermission(group.getPermission())) * @param player Velocity Player * @return subcommands unavailable for the player */ - public HashSet getSuggestions(Player player, HashMap groups) { + public HashSet getSuggestions(Player player) { HashSet suggestionList = new HashSet<>(); + HashMap groups = configCache.getGroupList(); for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) suggestionList.addAll(s.getValue().getSubCommands()); - if (player.hasPermission(s.getValue().getPermission())) continue; + if (!player.hasPermission(s.getValue().getPermission())) continue; suggestionList.addAll(s.getValue().getSubCommands()); } return suggestionList; diff --git a/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java b/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java index fd6be02..cedec3f 100644 --- a/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java +++ b/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java @@ -100,7 +100,7 @@ public static HashSet getSuggestions(ProxiedPlayer player) { for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) suggestionList.addAll(s.getValue().getSubCommands()); - if (player.hasPermission(s.getValue().getPermission())) continue; + if (!player.hasPermission(s.getValue().getPermission())) continue; suggestionList.addAll(s.getValue().getSubCommands()); } return suggestionList;