diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-02-10 16:18:36 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-02-10 16:18:36 -0600 |
commit | 256070fc5957b8f36e83d2816986c4116287fd1e (patch) | |
tree | 9dc63d857b5b8809c29f7771f1321c70f78976fc | |
parent | 45d2e3ff200b9a8523ed84a916fffc00f12a97c1 (diff) | |
download | bukkit-256070fc5957b8f36e83d2816986c4116287fd1e.tar bukkit-256070fc5957b8f36e83d2816986c4116287fd1e.tar.gz bukkit-256070fc5957b8f36e83d2816986c4116287fd1e.tar.lz bukkit-256070fc5957b8f36e83d2816986c4116287fd1e.tar.xz bukkit-256070fc5957b8f36e83d2816986c4116287fd1e.zip |
Remove extra events from alias execution.
When executing an alias we already call an event for the alias itself. The
extra events are not needed for logging purposes as the alias itself is
logged and the events cause issues for plugins trying to do spam checking
on their own.
-rw-r--r-- | src/main/java/org/bukkit/command/FormattedCommandAlias.java | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java index 40de5e2f..3f07d7f4 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -23,24 +23,6 @@ public class FormattedCommandAlias extends Command { ArrayList<String> commands = new ArrayList<String>(); for (String formatString : formatStrings) { try { - if (sender instanceof Player) { - PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent((Player) sender, "/" + formatString); - Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { - return false; - } else { - formatString = event.getMessage().substring(1); - } - } else if (sender instanceof RemoteConsoleCommandSender) { - RemoteServerCommandEvent event = new RemoteServerCommandEvent(sender, formatString); - Bukkit.getPluginManager().callEvent(event); - formatString = event.getCommand(); - } else if (sender instanceof ConsoleCommandSender) { - ServerCommandEvent event = new ServerCommandEvent(sender, formatString); - Bukkit.getPluginManager().callEvent(event); - formatString = event.getCommand(); - } - commands.add(buildCommand(formatString, args)); } catch (Throwable throwable) { if (throwable instanceof IllegalArgumentException) { |