All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.command.MultipleCommandAlias Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package org.bukkit.command;

/**
 * Represents a command that delegates to one or more other commands
 */
public class MultipleCommandAlias extends Command {
  private final Command[] commands;

  public MultipleCommandAlias(String name, Command[] commands) {
    super(name);
    this.commands = commands;
  }

  /**
   * Gets the commands associated with the multi-command alias.
   *
   * @return commands associated with alias
   */
  public Command[] getCommands() {
    return 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;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy