Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
MultipleCommandAlias.java
1 package org.bukkit.command;
2 
3 /**
4  * Represents a command that delegates to one or more other commands
5  */
6 public class MultipleCommandAlias extends Command {
7  private Command[] commands;
8 
9  public MultipleCommandAlias(String name, Command[] commands) {
10  super(name);
11  this.commands = commands;
12  }
13 
14  /**
15  * Gets the commands associated with the multi-command alias.
16  *
17  * @return commands associated with alias
18  */
19  public Command[] getCommands() {
20  return commands;
21  }
22 
23  @Override
24  public boolean execute(CommandSender sender, String commandLabel, String[] args) {
25  boolean result = false;
26 
27  for (Command command : commands) {
28  result |= command.execute(sender, commandLabel, args);
29  }
30 
31  return result;
32  }
33 }
abstract boolean execute(CommandSender sender, String commandLabel, String[] args)