improved command execution check

This commit is contained in:
youhavetrouble
2020-07-22 19:44:55 +02:00
parent 733b556166
commit 26b05aef7b
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>eu.endermite</groupId> <groupId>eu.endermite</groupId>
<artifactId>CommandWhitelist</artifactId> <artifactId>CommandWhitelist</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>CommandWhitelist</name> <name>CommandWhitelist</name>
@@ -26,7 +26,9 @@ public class PlayerCommandPreProcess implements Listener {
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) { if (player.hasPermission("commandwhitelist.commands." + s.getKey())) {
for (String comm : s.getValue()) { for (String comm : s.getValue()) {
comm = comm.toLowerCase(); comm = comm.toLowerCase();
if (command.startsWith("/" + comm)) { if (command.equalsIgnoreCase("/"+comm))
return;
else if (command.startsWith("/" + comm + " ")) {
return; return;
} }
} }