revert calebs broken patch

This commit is contained in:
Telesphoreo 2020-11-19 23:22:00 -06:00 committed by GitHub
parent 5cdbae0166
commit de0d6853b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Run any command on all users, username placeholder = ?.", usage = "/<command> [fluff] ? [fluff] ?") @CommandParameters(description = "Run any command on all users, username placeholder = ?.", usage = "/<command> [fluff] ? [fluff] ?")
public class Command_wildcard extends FreedomCommand public class Command_wildcard extends FreedomCommand
{ {
public static final List<String> BLOCKED_COMMANDS = Arrays.asList( public static final List<String> BLOCKED_COMMANDS = Arrays.asList(
"wildcard", "wildcard",
"gtfo", "gtfo",
@ -51,15 +52,15 @@ public class Command_wildcard extends FreedomCommand
aliases = Arrays.asList(fCmd.getAliases().split(",")); aliases = Arrays.asList(fCmd.getAliases().split(","));
} }
for (String arg : args) for (String blockedCommand : BLOCKED_COMMANDS)
{ {
String strCommand = StringUtils.strip(arg, "/"); if (blockedCommand.equals(args[0].toLowerCase()) || aliases.contains(blockedCommand))
if (BLOCKED_COMMANDS.contains(strCommand.toLowerCase()) || aliases.contains(strCommand.toLowerCase()))
{ {
msg("Did you really think that was going to work?", ChatColor.RED); msg("Did you really think that was going to work?", ChatColor.RED);
return true; return true;
} }
} }
String baseCommand = StringUtils.join(args, " "); String baseCommand = StringUtils.join(args, " ");
if (plugin.cb.isCommandBlocked(baseCommand, sender)) if (plugin.cb.isCommandBlocked(baseCommand, sender))
@ -74,6 +75,7 @@ public class Command_wildcard extends FreedomCommand
msg("Running Command: " + runCommand); msg("Running Command: " + runCommand);
server.dispatchCommand(sender, runCommand); server.dispatchCommand(sender, runCommand);
} }
return true; return true;
} }
} }