CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
This is the root node for creating a command as a tree. More...
Public Member Functions | |
Impl | then (final AbstractArgumentTree<?, Argument, CommandSender > tree) |
Create a child branch on the tree. More... | |
final Impl | thenNested (List< AbstractArgumentTree<?, Argument, CommandSender > > trees) |
Creates a chain of child branches starting at this node. More... | |
final Impl | thenNested (final AbstractArgumentTree<?, Argument, CommandSender >... trees) |
Creates a chain of child branches starting at this node. More... | |
void | register (String namespace) |
Registers the command with a given namespace. More... | |
String | getName () |
Returns the name of this command. More... | |
Impl | withPermission (CommandPermission permission) |
Applies a permission to the current command builder. More... | |
Impl | withPermission (String permission) |
Applies a permission to the current command builder. More... | |
Impl | withoutPermission (CommandPermission permission) |
Applies a permission to the current command builder. More... | |
Impl | withoutPermission (String permission) |
Applies a permission to the current command builder. More... | |
Impl | withRequirement (Predicate< CommandSender > requirement) |
Adds a requirement that has to be satisfied to use this command. More... | |
Impl | withAliases (String... aliases) |
Adds an array of aliases to the current command builder. More... | |
CommandPermission | getPermission () |
Returns the permission associated with this command. More... | |
void | setPermission (CommandPermission permission) |
Sets the permission required to run this command. More... | |
String[] | getAliases () |
Returns an array of aliases that can be used to run this command. More... | |
void | setAliases (String[] aliases) |
Sets the aliases for this command. More... | |
Predicate< CommandSender > | getRequirements () |
Returns the requirements that must be satisfied to run this command. More... | |
void | setRequirements (Predicate< CommandSender > requirements) |
Sets the requirements that must be satisfied to run this command. More... | |
String | getShortDescription () |
Returns the short description for this command. More... | |
Impl | withShortDescription (String description) |
Sets the short description for this command. More... | |
String | getFullDescription () |
Returns the full description for this command. More... | |
Impl | withFullDescription (String description) |
Sets the full description for this command. More... | |
Impl | withUsage (String... usage) |
Sets the full usage for this command. More... | |
String[] | getUsage () |
Returns the usage for this command. More... | |
Impl | withHelp (String shortDescription, String fullDescription) |
Sets the short and full description for this command. More... | |
void | override () |
Overrides a command. More... | |
void | register () |
Registers this command with the default namespace. | |
CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | getExecutor () |
Returns the executors that this command has. More... | |
void | setExecutor (CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > executor) |
Sets the executors for this command. More... | |
Impl | clearExecutors () |
Clear all executors from the current command builder. More... | |
Impl | instance () |
Returns the instance of this class with the class Impl. More... | |
Protected Member Functions | |
AbstractCommandTree (final String commandName) | |
Creates a main root node for a command tree with a given command name. More... | |
Protected Attributes | |
final CommandMetaData< CommandSender > | meta |
The Command's meta-data for this executable command. | |
CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | executor = new CommandAPIExecutor<>() |
The CommandAPIExecutor for this executable implementation. | |
This is the root node for creating a command as a tree.
<Impl> | The class extending this class, used as the return type for chain calls |
<Argument> | The implementation of AbstractArgument being used by this class |
<CommandSender> | The CommandSender class used by the class extending this class |
|
protected |
Creates a main root node for a command tree with a given command name.
commandName | The name of the command to create |
|
inherited |
Clear all executors from the current command builder.
|
inherited |
Returns an array of aliases that can be used to run this command.
|
inherited |
Returns the executors that this command has.
|
inherited |
Returns the full description for this command.
|
inherited |
Returns the name of this command.
|
inherited |
Returns the permission associated with this command.
|
inherited |
Returns the requirements that must be satisfied to run this command.
|
inherited |
Returns the short description for this command.
|
inherited |
Returns the usage for this command.
|
inherited |
Returns the instance of this class with the class Impl.
Used for chaining builder methods.
Implemented in dev.jorel.commandapi.arguments.Argument< T >.
|
inherited |
Overrides a command.
Effectively the same as unregistering the command using CommandAPI.unregister() and then registering the command using .register()
void dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.register | ( | String | namespace | ) |
Registers the command with a given namespace.
namespace | The namespace of this command. This cannot be null |
NullPointerException | if the namespace is null |
Reimplemented from dev.jorel.commandapi.ExecutableCommand< Impl, CommandSender >.
|
inherited |
Sets the aliases for this command.
aliases | the aliases for this command |
|
inherited |
Sets the executors for this command.
executor | the executors for this command |
|
inherited |
Sets the permission required to run this command.
permission | the permission required to run this command |
|
inherited |
Sets the requirements that must be satisfied to run this command.
requirements | the requirements that must be satisfied to run this command |
Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.then | ( | final AbstractArgumentTree<?, Argument, CommandSender > | tree | ) |
Create a child branch on the tree.
tree | the child node |
final Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.thenNested | ( | final AbstractArgumentTree<?, Argument, CommandSender >... | trees | ) |
Creates a chain of child branches starting at this node.
thenNested(a, b, c)
is equivalent to then
(a.then(b.then(c)))
.
trees | The child branches to add in a chain. |
final Impl dev.jorel.commandapi.AbstractCommandTree< Impl, Argument, CommandSender >.thenNested | ( | List< AbstractArgumentTree<?, Argument, CommandSender > > | trees | ) |
Creates a chain of child branches starting at this node.
thenNested(a, b, c)
is equivalent to then
(a.then(b.then(c)))
.
trees | The child branches to add in a chain. |
|
inherited |
Adds an array of aliases to the current command builder.
aliases | An array of aliases which can be used to execute this command |
|
inherited |
Sets the full description for this command.
This is the help which is shown in the specific /help page for this command (e.g. /help mycommand).
description | the full description for this command |
|
inherited |
Sets the short and full description for this command.
This is a short-hand for the ExecutableCommand#withShortDescription
and ExecutableCommand#withFullDescription
methods.
shortDescription | the short description for this command |
fullDescription | the full description for this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Applies a permission to the current command builder.
permission | The permission node required to execute this command |
|
inherited |
Adds a requirement that has to be satisfied to use this command.
This method can be used multiple times and each use of this method will AND its requirement with the previously declared ones
requirement | the predicate that must be satisfied to use this command |
|
inherited |
Sets the short description for this command.
This is the help which is shown in the main /help menu.
description | the short description for this command |
|
inherited |
Sets the full usage for this command.
This is the usage which is shown in the specific /help page for this command (e.g. /help mycommand).
usage | the full usage for this command |