Class CompositeCommand
java.lang.Object
dk.lockfuglsang.minecraft.command.completion.AbstractTabCompleter
dk.lockfuglsang.minecraft.command.CompositeCommand
- All Implemented Interfaces:
Command
,org.bukkit.command.TabCompleter
- Direct Known Subclasses:
BaseCommandExecutor
public class CompositeCommand
extends AbstractTabCompleter
implements Command, org.bukkit.command.TabCompleter
Command with nested commandMap inside.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCompositeCommand(String name, String permission, String description)
CompositeCommand(String name, String permission, String params, String description, UUID... permissionOverride)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept(CommandVisitor visitor)
Visitor pattern.void
addFeaturePermission(String perm, String description)
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.static String
getParamsAsString(Command cmd)
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
boolean
hasPermission(org.bukkit.command.CommandSender sender, String permission)
Allows for other than permission checkingboolean
hasPermissionOverride(org.bukkit.command.CommandSender sender)
onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
void
setParent(CompositeCommand parent)
Assigns a parent command.void
showUsage(org.bukkit.command.CommandSender sender, int page)
Methods inherited from class dk.lockfuglsang.minecraft.command.completion.AbstractTabCompleter
filter
-
Field Details
-
HELP_PATTERN
- See Also:
- Constant Field Values
-
-
Constructor Details
-
CompositeCommand
-
CompositeCommand
-
-
Method Details
-
add
-
addTab
-
getName
Description copied from interface:Command
Returns the name of the sub-command. -
getAliases
Description copied from interface:Command
Returns aliases for the command. Can be empty, cannot benull
.- Specified by:
getAliases
in interfaceCommand
-
getPermission
Description copied from interface:Command
The permission of the command. Can benull
.- Specified by:
getPermission
in interfaceCommand
-
getDescription
Description copied from interface:Command
A short description of the sub-command. Used when listing the commands with others.- Specified by:
getDescription
in interfaceCommand
-
getUsage
Description copied from interface:Command
A more verbatim description of the command. Used when/command help
is executed. -
getParams
Description copied from interface:Command
The list of parameters accepted by the command. Can be empty, notnull
. -
execute
public boolean execute(org.bukkit.command.CommandSender sender, String alias, Map<String,Object> data, String... args)Description copied from interface:Command
Executes the command. -
showUsage
public void showUsage(org.bukkit.command.CommandSender sender, int page) -
getParamsAsString
-
hasAccess
-
onTabComplete
public List<String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)- Specified by:
onTabComplete
in interfaceorg.bukkit.command.TabCompleter
- Overrides:
onTabComplete
in classAbstractTabCompleter
-
getTabCompleter
public org.bukkit.command.TabCompleter getTabCompleter()Description copied from interface:Command
Optional TabCompleter to override the default ones. Can benull
- Specified by:
getTabCompleter
in interfaceCommand
-
getParent
Description copied from interface:Command
Returns the parent command (if one such is available). May returnnull
. -
setParent
Description copied from interface:Command
Assigns a parent command. -
getChildren
-
accept
Description copied from interface:Command
Visitor pattern. -
addFeaturePermission
-
getFeaturePermissions
Description copied from interface:Command
Returns a map of feature-toggling permissions supporte by this command.- Specified by:
getFeaturePermissions
in interfaceCommand
- Returns:
- A map of permission-node as key, and description as value.
-
hasPermissionOverride
public boolean hasPermissionOverride(org.bukkit.command.CommandSender sender) -
hasPermission
Description copied from interface:Command
Allows for other than permission checking- Specified by:
hasPermission
in interfaceCommand
- Parameters:
sender
- The commandSender requesting permissionpermission
- The permission- Returns:
true
if the sender can execute this command
-