/** * Register a command so that it may be executed. * * @param plugin the plugin owning this command * @param command the command to register */ public void registerCommand(Plugin plugin, Command command) { commandMap.put( command.getName().toLowerCase( Locale.ROOT ), command ); for ( String alias : command.getAliases() ) { commandMap.put( alias.toLowerCase( Locale.ROOT ), command ); } commandsByPlugin.put( plugin, command ); }
public void addSubCommand(Command command) { subCommands.put(command.getName(), command); for (String alias : command.getAliases()) { subCommands.put(alias, command); } }
/** * Register a command so that it may be executed. * * @param plugin the plugin owning this command * @param command the command to register */ public void registerCommand(Plugin plugin, Command command) { commandMap.put( command.getName().toLowerCase(), command ); for ( String alias : command.getAliases() ) { commandMap.put( alias.toLowerCase(), command ); } commandsByPlugin.put( plugin, command ); }