diff --git a/CommandWhitelistBukkit/pom.xml b/CommandWhitelistBukkit/pom.xml
index 7091aa7..3366061 100644
--- a/CommandWhitelistBukkit/pom.xml
+++ b/CommandWhitelistBukkit/pom.xml
@@ -6,7 +6,7 @@
eu.endermite.commandwhitelist
CommandWhitelist
- 2.5.1
+ 2.5.2
Bukkit
diff --git a/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/PlayerCommandPreProcessListener.java b/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/PlayerCommandPreProcessListener.java
index 4fa5643..7953958 100644
--- a/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/PlayerCommandPreProcessListener.java
+++ b/CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/PlayerCommandPreProcessListener.java
@@ -1,6 +1,7 @@
package eu.endermite.commandwhitelist.bukkit.listeners;
import eu.endermite.commandwhitelist.bukkit.CommandWhitelistBukkit;
+import eu.endermite.commandwhitelist.common.CWPermission;
import eu.endermite.commandwhitelist.common.CommandUtil;
import eu.endermite.commandwhitelist.common.ConfigCache;
import eu.endermite.commandwhitelist.common.commands.CWCommand;
@@ -16,7 +17,7 @@ public class PlayerCommandPreProcessListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
- if (player.hasPermission("commandwhitelist.bypass")) return;
+ if (player.hasPermission(CWPermission.BYPASS.permission())) return;
String caseSensitiveLabel = CommandUtil.getCommandLabel(event.getMessage());
String label = caseSensitiveLabel.toLowerCase();
event.setMessage(event.getMessage().replaceFirst(caseSensitiveLabel, label));
diff --git a/CommandWhitelistCommon/pom.xml b/CommandWhitelistCommon/pom.xml
index e48c29a..99506d3 100644
--- a/CommandWhitelistCommon/pom.xml
+++ b/CommandWhitelistCommon/pom.xml
@@ -6,7 +6,7 @@
eu.endermite.commandwhitelist
CommandWhitelist
- 2.5.1
+ 2.5.2
Common
diff --git a/CommandWhitelistVelocity/pom.xml b/CommandWhitelistVelocity/pom.xml
index b2932a3..5cf8ac3 100644
--- a/CommandWhitelistVelocity/pom.xml
+++ b/CommandWhitelistVelocity/pom.xml
@@ -6,7 +6,7 @@
eu.endermite.commandwhitelist
CommandWhitelist
- 2.5.1
+ 2.5.2
Velocity
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 aece787..9e35f86 100644
--- a/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java
+++ b/CommandWhitelistVelocity/src/main/java/eu/endermite/commandwhitelist/velocity/CommandWhitelistVelocity.java
@@ -11,6 +11,7 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer;
import eu.endermite.commandwhitelist.common.CWGroup;
import eu.endermite.commandwhitelist.common.CWPermission;
+import eu.endermite.commandwhitelist.common.CommandUtil;
import eu.endermite.commandwhitelist.common.ConfigCache;
import eu.endermite.commandwhitelist.common.commands.CWCommand;
import eu.endermite.commandwhitelist.velocity.command.VelocityMainCommand;
@@ -87,10 +88,12 @@ public class CommandWhitelistVelocity {
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
+ // Workaround for velocity executing "/ command" as valid command
+ String command = event.getCommand().trim();
+
HashSet allowedCommands = CommandWhitelistVelocity.getCommands(player);
- String command = event.getCommand().split(" ")[0];
- if (server.getCommandManager().hasCommand(command)
- && !allowedCommands.contains(command))
+ String label = CommandUtil.getCommandLabel(command);
+ if (server.getCommandManager().hasCommand(label) && !allowedCommands.contains(label))
event.setResult(CommandExecuteEvent.CommandResult.forwardToServer());
}
diff --git a/CommandWhitelistWaterfall/pom.xml b/CommandWhitelistWaterfall/pom.xml
index e76667e..45cbb42 100644
--- a/CommandWhitelistWaterfall/pom.xml
+++ b/CommandWhitelistWaterfall/pom.xml
@@ -6,7 +6,7 @@
eu.endermite.commandwhitelist
CommandWhitelist
- 2.5.1
+ 2.5.2
Waterfall
diff --git a/pom.xml b/pom.xml
index 636c4f1..62b40ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
eu.endermite.commandwhitelist
CommandWhitelist
- 2.5.1
+ 2.5.2
CommandWhitelistCommon
CommandWhitelistBukkit