better command check

This commit is contained in:
youhavetrouble
2020-07-11 17:46:55 +02:00
parent 666375ee91
commit 97f0403b2e
3 changed files with 3 additions and 3 deletions
@@ -20,11 +20,12 @@ public class PlayerCommandPreProcess implements Listener {
return;
}
String command = event.getMessage();
String command = event.getMessage().toLowerCase();
for (Map.Entry<String, List<String>> s : CommandWhitelist.getConfigCache().getPermList().entrySet()) {
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) {
for (String comm : s.getValue()) {
comm = comm.toLowerCase();
if (command.startsWith("/" + comm)) {
return;
}
@@ -5,7 +5,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import java.util.*;
public class PlayerCommandSend implements Listener {