Package noppes.npcs.api
Interface ICommand
-
public interface ICommandRepresents a custom command that can be registered and executed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAliases(String... aliases)Adds one or more aliases for this command.String[]getAliases()Gets all aliases for this command.StringgetCommandName()Gets the name of this command.StringgetCommandUsage()Gets the usage string for this command.intgetPermissionLevel()Gets the permission level required to execute this command.booleanhasAlias(String alias)Checks whether this command has a specific alias.voidremoveAlias(String alias)Removes an alias from this command.voidsetCommandName(String commandName)Sets the name of this command.voidsetCommandUsage(String commandUsage)Sets the usage string for this command.voidsetPermissionLevel(int permissionLevel)Sets the permission level required to execute this command.
-
-
-
Method Detail
-
getCommandName
String getCommandName()
Gets the name of this command.- Returns:
- the command name
-
getCommandUsage
String getCommandUsage()
Gets the usage string for this command.- Returns:
- the command usage description
-
getPermissionLevel
int getPermissionLevel()
Gets the permission level required to execute this command.- Returns:
- the permission level (0 = all, 1 = moderator, 2 = gamemaster, 3 = admin, 4 = owner)
-
setCommandName
void setCommandName(String commandName)
Sets the name of this command.- Parameters:
commandName- the command name to set
-
setCommandUsage
void setCommandUsage(String commandUsage)
Sets the usage string for this command.- Parameters:
commandUsage- the command usage description to set
-
setPermissionLevel
void setPermissionLevel(int permissionLevel)
Sets the permission level required to execute this command.- Parameters:
permissionLevel- the permission level (0 = all, 1 = moderator, 2 = gamemaster, 3 = admin, 4 = owner)
-
getAliases
String[] getAliases()
Gets all aliases for this command.- Returns:
- an array of alias strings
-
addAliases
void addAliases(String... aliases)
Adds one or more aliases for this command.- Parameters:
aliases- the alias(es) to add
-
hasAlias
boolean hasAlias(String alias)
Checks whether this command has a specific alias.- Parameters:
alias- the alias to check for- Returns:
- true if the alias exists
-
removeAlias
void removeAlias(String alias)
Removes an alias from this command.- Parameters:
alias- the alias to remove
-
-