mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 14:36:56 +00:00
better command check
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user