|
CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
A wrapper class for Minecraft 1.12's functions. More...
Inheritance diagram for dev.jorel.commandapi.wrappers.FunctionWrapper:Public Member Functions | |
| FunctionWrapper (NamespacedKey minecraftKey, @SuppressWarnings("rawtypes") ToIntFunction invoker, Object clwArgB, Function< Entity, Object > mapper, String[] internalCommands) | |
| Creates a FunctionWrapper. More... | |
| int | run () |
| Executes this function as the executor of the command. More... | |
| int | runAs (Entity e) |
| Executes this function as an entity. More... | |
| int | run (CommandSender sender) |
| Runs this function with a given CommandSender. More... | |
| String[] | getCommands () |
| Returns an array of commands that will be executed by this FunctionWrapper. More... | |
| NamespacedKey | getKey () |
| Returns the NamespacedKey that uniquely represents this object. More... | |
Static Public Member Functions | |
| static FunctionWrapper | fromSimpleFunctionWrapper (SimpleFunctionWrapper wrapper, Object commandListenerWrapper, Function< Entity, Object > mapper) |
| Converts a SimpleFunctionWrapper into a FunctionWrapper. More... | |
| static SimpleFunctionWrapper[] | getTag (NamespacedKey key) |
| Returns a SimpleFunctionWrapper[], which is an array of all of the functions that this tag contains. More... | |
| static SimpleFunctionWrapper | getFunction (NamespacedKey key) |
| Returns a SimpleFunctionWrapper representation of the Minecraft function for the provided NamespacedKey. More... | |
| static Set< NamespacedKey > | getFunctions () |
| Returns a set of all functions that the server has registered. More... | |
| static Set< NamespacedKey > | getTags () |
| Returns a set of all tags that the server has registered. More... | |
A wrapper class for Minecraft 1.12's functions.
| dev.jorel.commandapi.wrappers.FunctionWrapper.FunctionWrapper | ( | NamespacedKey | minecraftKey, |
| @SuppressWarnings("rawtypes") ToIntFunction | invoker, | ||
| Object | clwArgB, | ||
| Function< Entity, Object > | mapper, | ||
| String[] | internalCommands | ||
| ) |
Creates a FunctionWrapper.
| minecraftKey | the MinecraftKey which is used to reference this function |
| invoker | a method which, when invoked, runs the function |
| clwArgB | the instance of the CommandListenerWrapper which executed this command |
| mapper | a function that maps a Bukkit Entity to a Minecraft Entity |
| internalCommands | a String[] of internal commands that this customFunction represents. Typically customFunction.b().map(Object::toString) |
|
static |
Converts a SimpleFunctionWrapper into a FunctionWrapper.
| wrapper | the SimpleFunctionWrapper to convert |
| commandListenerWrapper | the instance of the CommandListenerWrapper which will be applied to this function |
| mapper | a function that maps a Bukkit Entity to a Minecraft Entity |
|
inherited |
Returns an array of commands that will be executed by this FunctionWrapper.
|
staticinherited |
Returns a SimpleFunctionWrapper representation of the Minecraft function for the provided NamespacedKey.
| key | a NamespacedKey representation of the function |
|
staticinherited |
Returns a set of all functions that the server has registered.
|
inherited |
Returns the NamespacedKey that uniquely represents this object.
|
staticinherited |
Returns a SimpleFunctionWrapper[], which is an array of all of the functions that this tag contains.
| key | a NamespacedKey representation of the tag. This key should not include a # symbol. |
|
staticinherited |
Returns a set of all tags that the server has registered.
| int dev.jorel.commandapi.wrappers.FunctionWrapper.run | ( | ) |
Executes this function as the executor of the command.
|
inherited |
Runs this function with a given CommandSender.
| sender | the sender to use to run this function |
| int dev.jorel.commandapi.wrappers.FunctionWrapper.runAs | ( | Entity | e | ) |
Executes this function as an entity.
| e | entity to execute this function |