Class CustomCommand
java.lang.Object
net.gcnt.additionsplus.files.commands.CustomCommand
Class that contains all information about a custom command.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a list of actions that will be performed when the command is being executed.Get a list of aliases for this command.static CustomCommand
getCommandByAlias(String alias)
Search a command by its alias.static CustomCommand
getCommandByName(String name)
Search a command by its name/identifier.Get the command query that has to be executed.long
Get the cooldown in ticks of this command.Get the on cooldown message that is sent when the sender is trying to execute the command again while on cooldown.Get the bukkit description message that is displayed in /? commandGet the no permission message that is sent when the sender does not have the right permission.Get the permission required to execute this command.Get the assigned plugin for this command.static List<CustomCommand>
getSimilarCommands(String command)
Get a list of custom commands that look most like the provided command string.getUsage()
Get the bukkit usage message that is displayed in /? commandboolean
Whether the custom command should be registered to Bukkit.
-
Constructor Details
-
CustomCommand
-
CustomCommand
-
-
Method Details
-
getCommandByName
Search a command by its name/identifier.- Parameters:
name
- Name of the command.- Returns:
CustomCommand
when found, null when invalid.
-
getCommandByAlias
Search a command by its alias.- Parameters:
alias
- Alias of the command.- Returns:
CustomCommand
when found, null when invalid.
-
getSimilarCommands
Get a list of custom commands that look most like the provided command string.- Parameters:
command
- Command string as executed by the player/console.- Returns:
- List of
CustomCommand
that match the query.
-
getPlugin
Get the assigned plugin for this command. This is AdditionsPlus by default.- Returns:
String
plugin when specified, null if not.
-
getCommandName
Get the command query that has to be executed.- Returns:
- Command string.
-
getAliases
Get a list of aliases for this command.- Returns:
- List
String
with aliases.
-
getPermission
Get the permission required to execute this command.- Returns:
String
when specified, null if not.
-
getNoPermissionMessage
Get the no permission message that is sent when the sender does not have the right permission.- Returns:
String
no-permission message.
-
getCooldown
public long getCooldown()Get the cooldown in ticks of this command. Cooldown is how much time a user has to wait in order to execute the command again.- Returns:
Long
cooldown in ticks.
-
getCooldownMessage
Get the on cooldown message that is sent when the sender is trying to execute the command again while on cooldown.- Returns:
String
cooldown message.
-
isRegister
public boolean isRegister()Whether the custom command should be registered to Bukkit. When true, the command can be executed from both console and in-game, and from other plugins as well.- Returns:
Boolean
whether the command should be register.
-
getActions
Get a list of actions that will be performed when the command is being executed.- Returns:
- List of
String
actions.
-
getUsage
Get the bukkit usage message that is displayed in /? command- Returns:
String
usage message, null if not specified.
-
getDescription
Get the bukkit description message that is displayed in /? command- Returns:
String
description message.
-