From 1e4de5709dbc477970139b0d3a199fcfbd727dfa Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Tue, 6 Jul 2021 16:55:28 +0200 Subject: [PATCH] more permission refactoring --- .../commandwhitelist/bukkit/CommandWhitelistBukkit.java | 2 +- .../commandwhitelist/velocity/CommandWhitelistVelocity.java | 3 +-- .../commandwhitelist/waterfall/CommandWhitelistWaterfall.java | 2 +- 3 files changed, 3 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 d14e8f4..0d6133b 100644 --- a/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java +++ b/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/CommandWhitelistBukkit.java @@ -99,7 +99,7 @@ public class CommandWhitelistBukkit extends JavaPlugin { for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) commandList.addAll(s.getValue().getCommands()); - else if (player.hasPermission("commandwhitelist.group." + s.getKey())) + else if (player.hasPermission(s.getValue().getPermission())) commandList.addAll(s.getValue().getCommands()); } return commandList; 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 f7aca4f..5679e29 100644 --- a/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java +++ b/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java @@ -50,7 +50,6 @@ public class CommandWhitelistVelocity { configCache = new ConfigCache(new File(String.valueOf(folder), "config.yml"), false, logger); else configCache.reloadConfig(); - } public static void reloadConfig(CommandSource source) { @@ -108,7 +107,7 @@ public class CommandWhitelistVelocity { for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) commandList.addAll(s.getValue().getCommands()); - else if (player.hasPermission("commandwhitelist.group." + s.getKey())) + else if (player.hasPermission(s.getValue().getPermission())) commandList.addAll(s.getValue().getCommands()); } return commandList; 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 bb12359..6785c51 100644 --- a/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java +++ b/CommandWhitelistWaterfall/src/main/java/eu/endermite/commandwhitelist/waterfall/CommandWhitelistWaterfall.java @@ -81,7 +81,7 @@ public final class CommandWhitelistWaterfall extends Plugin { for (Map.Entry s : groups.entrySet()) { if (s.getKey().equalsIgnoreCase("default")) commandList.addAll(s.getValue().getCommands()); - else if (player.hasPermission("commandwhitelist.group." + s.getKey())) + else if (player.hasPermission(s.getValue().getPermission())) commandList.addAll(s.getValue().getCommands()); } return commandList;