mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
better command check
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>eu.endermite</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.0.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>CommandWhitelist</name>
|
||||
|
||||
@@ -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