geforkt von Mirrors/Paper
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. By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Ursprung
cd6bf023f6
Commit
0d884197d5
@ -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) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren