|
CommandAPI 12.1.0
An API for the command UI introduced in Minecraft 1.13
|
Public Member Functions | |
| void | onLoad () |
| Platform-specific stuff that should happen when the CommandAPI is loaded, such as checking dependencies and initializing helper classes. | |
| void | onEnable () |
| Platform-specific stuff that should happen when the CommandAPI is enabled. | |
| void | onDisable () |
| Platform-specific stuff that should happen when the CommandAPI is disabled. | |
| AbstractCommandSender<? extends CommandSender > | getSenderForCommand (CommandContext< Source > cmdCtx, boolean forceNative) |
| Converts a Brigadier CommandContext into an AbstractCommandSender wrapping the platform's CommandSender. | |
| AbstractCommandSender<? extends CommandSender > | getCommandSenderFromCommandSource (Source source) |
| Converts the class used by Brigadier when running commands into an AbstractCommandSender wrapping the platform's CommandSender. | |
| Source | getBrigadierSourceFromCommandSender (AbstractCommandSender<? extends CommandSender > sender) |
| Converts a CommandSender wrapped in an AbstractCommandSender to an object Brigadier can use when running its commands. | |
| AbstractCommandSender<? extends CommandSender > | wrapCommandSender (CommandSender sender) |
Wraps a CommandSender in an AbstractCommandSender class, the inverse operation to AbstractCommandSender#getSource(). | |
| void | registerPermission (String string) |
| SuggestionProvider< Source > | getSuggestionProvider (SuggestionProviders suggestionProvider) |
| < Impl extends AbstractCommandAPICommand< Impl, Argument, CommandSender > boolean | checkRegistrationStatus (AbstractCommandAPICommand< Impl, Argument, CommandSender > command) |
| A pre-registration hook to prevent registration if not possible, for example on Paper before the bootstrapper runs but the CommandAPI already expects commands to be registered. | |
| void | preCommandRegistration (String commandName) |
| Stuff to run before a command is generated. | |
| void | postCommandRegistration (RegisteredCommand registeredCommand, LiteralCommandNode< Source > resultantNode, List< LiteralCommandNode< Source > > aliasNodes) |
| Stuff to run after a command has been generated. | |
| LiteralCommandNode< Source > | registerCommandNode (LiteralArgumentBuilder< Source > node, String namespace) |
| Registers a Brigadier command node and returns the built node. | |
| void | unregister (String commandName, boolean unregisterNamespaces) |
| Unregisters a command from the CommandGraph so it can't be run anymore. | |
| CommandAPIMessenger<?, ?> | setupMessenger () |
Creates a new CommandAPIMessenger for this platform. | |
| CommandDispatcher< Source > | getBrigadierDispatcher () |
| void | createDispatcherFile (File file, CommandDispatcher< Source > dispatcher) throws IOException |
| Creates a JSON file that describes the hierarchical structure of the commands that have been registered by the server. | |
| default CommandAPILogger | getLogger () |
| void | updateRequirements (AbstractPlayer<?> player) |
| Updates the requirements required for a given player to execute a command. | |
| AbstractCommandAPICommand<?, Argument, CommandSender > | newConcreteCommandAPICommand (CommandMetaData< CommandSender > meta) |
| Argument | newConcreteMultiLiteralArgument (String nodeName, String[] literals) |
| Argument | newConcreteLiteralArgument (String nodeName, String literal) |
| <Argument> | The implementation of AbstractArgument used for the platform |
| <CommandSender> | The class for running platforms commands |
| <Source> | The class for running Brigadier commands |
| < Impl extends AbstractCommandAPICommand< Impl, Argument, CommandSender > boolean dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.checkRegistrationStatus | ( | AbstractCommandAPICommand< Impl, Argument, CommandSender > | command | ) |
A pre-registration hook to prevent registration if not possible, for example on Paper before the bootstrapper runs but the CommandAPI already expects commands to be registered.
true if the command can be registered and false if that is going to be handled by the implementing platform later | void dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.createDispatcherFile | ( | File | file, |
| CommandDispatcher< Source > | dispatcher ) throws IOException |
Creates a JSON file that describes the hierarchical structure of the commands that have been registered by the server.
| file | The JSON file to write to |
| dispatcher | The Brigadier CommandDispatcher |
| IOException | When the file fails to be written to |
| CommandDispatcher< Source > dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.getBrigadierDispatcher | ( | ) |
| Source dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.getBrigadierSourceFromCommandSender | ( | AbstractCommandSender<? extends CommandSender > | sender | ) |
Converts a CommandSender wrapped in an AbstractCommandSender to an object Brigadier can use when running its commands.
| sender | The CommandSender to convert, wrapped in an AbstractCommandSender |
| AbstractCommandSender<? extends CommandSender > dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.getCommandSenderFromCommandSource | ( | Source | source | ) |
Converts the class used by Brigadier when running commands into an AbstractCommandSender wrapping the platform's CommandSender.
| source | The Brigadier source object |
| default CommandAPILogger dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.getLogger | ( | ) |
CommandAPI#setLogger(CommandAPILogger). | AbstractCommandSender<? extends CommandSender > dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.getSenderForCommand | ( | CommandContext< Source > | cmdCtx, |
| boolean | forceNative ) |
Converts a Brigadier CommandContext into an AbstractCommandSender wrapping the platform's CommandSender.
| cmdCtx | A Brigadier CommandContext |
| forceNative | True if the CommandSender should be forced into a native CommandSender |
| void dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.postCommandRegistration | ( | RegisteredCommand | registeredCommand, |
| LiteralCommandNode< Source > | resultantNode, | ||
| List< LiteralCommandNode< Source > > | aliasNodes ) |
Stuff to run after a command has been generated.
| registeredCommand | A RegisteredCommand instance that holds the CommandAPI information for the command |
| resultantNode | The node that was registered |
| aliasNodes | Any alias nodes that were also registered as a part of this registration process |
| void dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.preCommandRegistration | ( | String | commandName | ) |
Stuff to run before a command is generated.
For Bukkit, this involves checking if a command was declared in the plugin.yml when it isn't supposed to be.
| commandName | The name of the command about to be registered |
| CommandAPIMessenger<?, ?> dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.setupMessenger | ( | ) |
Creates a new CommandAPIMessenger for this platform.
This is only intended to be called once by CommandAPIHandler when it is enabling the CommandAPI.
CommandAPIMessenger that was created. | void dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.unregister | ( | String | commandName, |
| boolean | unregisterNamespaces ) |
Unregisters a command from the CommandGraph so it can't be run anymore.
| commandName | the name of the command to unregister |
| unregisterNamespaces | whether the unregistration system should attempt to remove versions of the command that start with a namespace. Eg. minecraft:command, bukkit:command, or plugin:command |
| void dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.updateRequirements | ( | AbstractPlayer<?> | player | ) |
Updates the requirements required for a given player to execute a command.
| player | the player to update |
| AbstractCommandSender<? extends CommandSender > dev.jorel.commandapi.CommandAPIPlatform< Argument, CommandSender, Source >.wrapCommandSender | ( | CommandSender | sender | ) |
Wraps a CommandSender in an AbstractCommandSender class, the inverse operation to AbstractCommandSender#getSource().
| sender | The CommandSender to wrap |