public class CommandManager extends Object
| Constructor and Description |
|---|
CommandManager() |
| Modifier and Type | Method and Description |
|---|---|
Command |
getCommand(String name,
boolean alias)
Gets the command from its name
|
@NotNull Set<String> |
getCommandNames(boolean includeAliases)
Gets all command names
|
boolean |
hasCommand(String name,
boolean alias)
Checks whether a command with that name exists or not
|
boolean |
isAlias(String name)
Gets whether
name is a command alias or not |
void |
registerCommand(@NotNull CommandBuilder command)
Registers a new command
|
public void registerCommand(@NotNull
@NotNull CommandBuilder command)
command - The commandIllegalArgumentException - If command's name or one of its aliases is empty or contains spaces.
If command's name or one of its aliases are already usedpublic Command getCommand(String name, boolean alias)
name - The name of the commandalias - Whether name is a command alias or notpublic boolean hasCommand(String name, boolean alias)
name - The command namealias - Whether name is a command alias or nottrue if the command exists, otherwise falsepublic boolean isAlias(String name)
name is a command alias or notname - The command name/aliastrue if name is a command alias, false otherwiseCopyright © 2024. All rights reserved.