From de0d6853b7113af1bc57253cb6a17cf777da8819 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 19 Nov 2020 23:22:00 -0600 Subject: [PATCH] revert calebs broken patch --- .../totalfreedommod/command/Command_wildcard.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wildcard.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wildcard.java index 8b626886..a796b620 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wildcard.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wildcard.java @@ -14,6 +14,7 @@ import org.bukkit.entity.Player; @CommandParameters(description = "Run any command on all users, username placeholder = ?.", usage = "/ [fluff] ? [fluff] ?") public class Command_wildcard extends FreedomCommand { + public static final List BLOCKED_COMMANDS = Arrays.asList( "wildcard", "gtfo", @@ -51,15 +52,15 @@ public class Command_wildcard extends FreedomCommand aliases = Arrays.asList(fCmd.getAliases().split(",")); } - for (String arg : args) + for (String blockedCommand : BLOCKED_COMMANDS) { - String strCommand = StringUtils.strip(arg, "/"); - if (BLOCKED_COMMANDS.contains(strCommand.toLowerCase()) || aliases.contains(strCommand.toLowerCase())) + if (blockedCommand.equals(args[0].toLowerCase()) || aliases.contains(blockedCommand)) { msg("Did you really think that was going to work?", ChatColor.RED); return true; } } + String baseCommand = StringUtils.join(args, " "); if (plugin.cb.isCommandBlocked(baseCommand, sender)) @@ -74,6 +75,7 @@ public class Command_wildcard extends FreedomCommand msg("Running Command: " + runCommand); server.dispatchCommand(sender, runCommand); } + return true; } }