Class AbstractCommand
java.lang.Object
dk.lockfuglsang.minecraft.command.AbstractCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
DocumentCommand
,LanguageCommand
Convenience implementation of the Command
-
Constructor Summary
ConstructorDescriptionAbstractCommand(String name, String description)
AbstractCommand(String name, String permission, String description)
AbstractCommand(String name, String permission, String params, String description)
AbstractCommand(String name, String permission, String params, String description, String usage, UUID... permissionOverride)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept(CommandVisitor visitor)
Visitor pattern.void
addFeaturePermission(String perm, String description)
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 checkingboolean
hasPermissionOverride(org.bukkit.command.CommandSender sender)
static String
static String
Convenience method until we can fully rely on everybody running JRE 8.void
setParent(CompositeCommand parent)
Assigns a parent command.
-
Constructor Details
-
AbstractCommand
-
AbstractCommand
-
AbstractCommand
-
AbstractCommand
-
-
Method Details
-
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
. -
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. -
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.
-
join
Convenience method until we can fully rely on everybody running JRE 8.- Parameters:
args
- A list of argumentsdelim
- Delimiter to join them- Returns:
- A string containing the arguments concatenated.
-
join
-
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
-