|
CommandAPI 11.1.0
An API for the command UI introduced in Minecraft 1.13
|
The "brains" behind the CommandAPI. More...
Public Member Functions | |
| void | onLoad () |
| void | onEnable () |
| void | onDisable () |
| CommandAPIPlatform< Argument, CommandSender, Source > | getPlatform () |
| Command< Source > | generateCommand (Argument[] args, CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > executor, boolean converted) |
| Generates a command to be registered by the CommandAPI. More... | |
| void | writeDispatcherToFile () |
Static Public Member Functions | |
| static< CommandSource > String | getRawArgumentInput (CommandContext< CommandSource > cmdCtx, String key) |
| Returns the raw input for an argument for a given command context and its key. More... | |
| static CommandAPIHandler<?, ?, ?> | getInstance () |
| static Field | getField (Class<?> clazz, String name) |
| Caches a field using reflection if it is not already cached, then return the field of a given class. More... | |
| static Field | getField (Class<?> clazz, String name, String mojangMappedName) |
| Caches a field using reflection if it is not already cached, then return the field of a given class. More... | |
Protected Member Functions | |
| CommandAPIHandler (CommandAPIPlatform< Argument, CommandSender, Source > platform) | |
The "brains" behind the CommandAPI.
Handles command registration
| <Argument> | The implementation of AbstractArgument being used |
| <CommandSender> | The class for running platform commands |
| <Source> | The class for running Brigadier commands |
| Command< Source > dev.jorel.commandapi.CommandAPIHandler< Argument, CommandSender, Source >.generateCommand | ( | Argument[] | args, |
| CommandAPIExecutor< CommandSender, AbstractCommandSender<? extends CommandSender > > | executor, | ||
| boolean | converted | ||
| ) |
Generates a command to be registered by the CommandAPI.
| args | set of ordered argument pairs which contain the prompt text and their argument types |
| executor | code to be ran when the command is executed |
| converted | True if this command is being converted from another plugin, and false otherwise |
|
static |
Caches a field using reflection if it is not already cached, then return the field of a given class.
This will also make the field accessible.
| clazz | the class where the field is declared |
| name | the name of the field |
|
static |
Caches a field using reflection if it is not already cached, then return the field of a given class.
This will also make the field accessible.
| clazz | the class where the field is declared |
| name | the name of the field |
| mojangMappedName | the name of a field under Mojang mappings |
|
static |
Returns the raw input for an argument for a given command context and its key.
This effectively returns the string value that is currently typed for this argument
| <CommandSource> | the command source type |
| cmdCtx | the command context which is used to run this command |
| key | the node name for the argument |