001 package org.bukkit.command; 002 003 /** 004 * Represents a command that delegates to one or more other commands 005 */ 006 public class MultipleCommandAlias extends Command { 007 private Command[] commands; 008 009 public MultipleCommandAlias(String name, Command[] commands) { 010 super(name); 011 this.commands = commands; 012 } 013 014 /** 015 * Gets the commands associated with the multi-command alias. 016 * 017 * @return commands associated with alias 018 */ 019 public Command[] getCommands() { 020 return commands; 021 } 022 023 @Override 024 public boolean execute(CommandSender sender, String commandLabel, String[] args) { 025 boolean result = false; 026 027 for (Command command : commands) { 028 result |= command.execute(sender, commandLabel, args); 029 } 030 031 return result; 032 } 033 }