Interface Command
- All Known Implementing Classes:
AbstractCommand
,BaseCommandExecutor
,CompositeCommand
,DocumentCommand
,LanguageCommand
public interface Command
An abstraction for supporting nesting of commands.
This is a light-weight version of the BukkitCommand abstraction.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept(CommandVisitor visitor)
Visitor pattern.boolean
execute(org.bukkit.command.CommandSender sender, String alias, Map<String,Object> data, String... args)
Executes the command.String[]
Returns aliases for the command.A short description of the sub-command.Returns a map of feature-toggling permissions supporte by this command.getName()
Returns the name of the sub-command.String[]
The list of parameters accepted by the command.Returns the parent command (if one such is available).The permission of the command.org.bukkit.command.TabCompleter
Optional TabCompleter to override the default ones.getUsage()
A more verbatim description of the command.boolean
hasPermission(org.bukkit.command.CommandSender sender, String permission)
Allows for other than permission checkingvoid
setParent(CompositeCommand parent)
Assigns a parent command.
-
Method Details
-
getName
String getName()Returns the name of the sub-command. -
getPermission
String getPermission()The permission of the command. Can benull
. -
getDescription
String getDescription()A short description of the sub-command. Used when listing the commands with others. -
getUsage
String getUsage()A more verbatim description of the command. Used when/command help
is executed. -
getParams
String[] getParams()The list of parameters accepted by the command. Can be empty, notnull
. -
getAliases
String[] getAliases()Returns aliases for the command. Can be empty, cannot benull
. -
execute
boolean execute(org.bukkit.command.CommandSender sender, String alias, Map<String,Object> data, String... args)Executes the command. -
getTabCompleter
org.bukkit.command.TabCompleter getTabCompleter()Optional TabCompleter to override the default ones. Can benull
-
getParent
CompositeCommand getParent()Returns the parent command (if one such is available). May returnnull
. -
setParent
Assigns a parent command.- Parameters:
parent
-
-
accept
Visitor pattern.- Parameters:
visitor
- A visitor for this node.
-
getFeaturePermissions
Returns a map of feature-toggling permissions supporte by this command.- Returns:
- A map of permission-node as key, and description as value.
-
hasPermission
Allows for other than permission checking- Parameters:
sender
- The commandSender requesting permissionpermission
- The permission- Returns:
true
if the sender can execute this command
-