mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 350f50588e | |||
| 9a5820bbd6 | |||
| 3c31081b42 |
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<version>2.8.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>Bukkit</artifactId>
|
||||
|
||||
+2
-5
@@ -21,10 +21,6 @@ public class PlayerCommandPreProcessListener implements Listener {
|
||||
String caseSensitiveLabel = CommandUtil.getCommandLabel(event.getMessage());
|
||||
String label = caseSensitiveLabel.toLowerCase();
|
||||
|
||||
String fullCommand = event.getMessage().substring(label.length()+1);
|
||||
fullCommand = "/"+label+fullCommand;
|
||||
|
||||
event.setMessage(fullCommand);
|
||||
BukkitAudiences audiences = CommandWhitelistBukkit.getAudiences();
|
||||
ConfigCache config = CommandWhitelistBukkit.getConfigCache();
|
||||
|
||||
@@ -36,8 +32,9 @@ public class PlayerCommandPreProcessListener implements Listener {
|
||||
}
|
||||
|
||||
HashSet<String> bannedSubCommands = CommandWhitelistBukkit.getSuggestions(player);
|
||||
String messageWithoutSlash = event.getMessage().startsWith("/") ? event.getMessage().substring(1) : event.getMessage();
|
||||
for (String bannedSubCommand : bannedSubCommands) {
|
||||
if (event.getMessage().toLowerCase().substring(1).startsWith(bannedSubCommand)) {
|
||||
if (messageWithoutSlash.startsWith(bannedSubCommand)) {
|
||||
event.setCancelled(true);
|
||||
audiences.player(player).sendMessage(CWCommand.miniMessage.deserialize(config.prefix + config.subcommand_denied));
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<version>2.8.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>Common</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<version>2.8.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>Velocity</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<version>2.8.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>Waterfall</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user