the permission was flipped all those years...

This commit is contained in:
2024-07-14 14:19:55 +02:00
parent 1872ea87d7
commit e3c6103ec7
3 changed files with 5 additions and 4 deletions
@@ -128,7 +128,7 @@ public class CommandWhitelistBukkit extends JavaPlugin {
for (Map.Entry<String, CWGroup> 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;
@@ -127,12 +127,13 @@ public class CommandWhitelistVelocity {
* @param player Velocity Player
* @return subcommands unavailable for the player
*/
public HashSet<String> getSuggestions(Player player, HashMap<String, CWGroup> groups) {
public HashSet<String> getSuggestions(Player player) {
HashSet<String> suggestionList = new HashSet<>();
HashMap<String, CWGroup> groups = configCache.getGroupList();
for (Map.Entry<String, CWGroup> 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;
@@ -100,7 +100,7 @@ public final class CommandWhitelistWaterfall extends Plugin {
for (Map.Entry<String, CWGroup> 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;