The server config can now specify aliases to multiple (or none) commands, for example "debug: [version, plugin]" to run both version and plugin, or "plugins: []" to disable the plugins command
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
package org.bukkit.command;
|
||||
|
||||
/**
|
||||
* Represents a command that delegates to one or more other commands
|
||||
*/
|
||||
public class MultipleCommandAlias extends Command {
|
||||
private Command[] commands;
|
||||
|
||||
public MultipleCommandAlias(String name, Command[] commands) {
|
||||
super(name);
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
boolean result = false;
|
||||
|
||||
for (Command command : commands) {
|
||||
result |= command.execute(sender, commandLabel, args);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user