public interface Commodore
| Modifier and Type | Method and Description |
|---|---|
static Collection<String> |
getAliases(org.bukkit.command.Command command)
Gets all of the aliases known for the given command.
|
org.bukkit.command.CommandSender |
getBukkitSender(Object commandWrapperListener)
Gets the CommandSender associated with the passed CommandWrapperListener.
|
com.mojang.brigadier.CommandDispatcher |
getDispatcher()
Gets the current command dispatcher instance.
|
List<com.mojang.brigadier.tree.LiteralCommandNode<?>> |
getRegisteredNodes()
Gets a list of all nodes registered to the
CommandDispatcher by
this instance. |
default void |
register(org.bukkit.command.Command command,
com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder)
Registers the provided argument data to the dispatcher, against all
aliases defined for the
command. |
default void |
register(org.bukkit.command.Command command,
com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder,
Predicate<? super org.bukkit.entity.Player> permissionTest)
Registers the provided argument data to the dispatcher, against all
aliases defined for the
command. |
void |
register(org.bukkit.command.Command command,
com.mojang.brigadier.tree.LiteralCommandNode<?> node)
Registers the provided argument data to the dispatcher, against all
aliases defined for the
command. |
void |
register(org.bukkit.command.Command command,
com.mojang.brigadier.tree.LiteralCommandNode<?> node,
Predicate<? super org.bukkit.entity.Player> permissionTest)
Registers the provided argument data to the dispatcher, against all
aliases defined for the
command. |
default void |
register(com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder)
Registers the provided argument data to the dispatcher.
|
void |
register(com.mojang.brigadier.tree.LiteralCommandNode<?> node)
Registers the provided argument data to the dispatcher.
|
com.mojang.brigadier.CommandDispatcher getDispatcher()
CraftBukkit doesn't use the same dispatcher instance throughout the runtime of the server. The dispatcher instance is completely wiped (and replaced with a new instance) every time new plugins are loaded.
org.bukkit.command.CommandSender getBukkitSender(Object commandWrapperListener)
Minecraft calls brigadier command handlers with an instance of CommandWrapperListener, which cannot be accessed without accessing nms code. This method takes an Object as parameter, but the only type actually accepted is those from the S type provided by Minecraft.
commandWrapperListener - the CommandWrapperListener instance from nms.List<com.mojang.brigadier.tree.LiteralCommandNode<?>> getRegisteredNodes()
CommandDispatcher by
this instance.void register(org.bukkit.command.Command command,
com.mojang.brigadier.tree.LiteralCommandNode<?> node,
Predicate<? super org.bukkit.entity.Player> permissionTest)
command.
Additionally applies the CraftBukkit SuggestionProvider
to all arguments within the node, so ASK_SERVER suggestions can continue
to function for the command.
Players will only be sent argument data if they pass the provided
permissionTest.
command - the command to read aliases fromnode - the argument datapermissionTest - the predicate to check whether players should be sent argument datadefault void register(org.bukkit.command.Command command,
com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder,
Predicate<? super org.bukkit.entity.Player> permissionTest)
command.
Additionally applies the CraftBukkit SuggestionProvider
to all arguments within the node, so ASK_SERVER suggestions can continue
to function for the command.
Players will only be sent argument data if they pass the provided
permissionTest.
command - the command to read aliases fromargumentBuilder - the argument data, in a builder formpermissionTest - the predicate to check whether players should be sent argument datavoid register(org.bukkit.command.Command command,
com.mojang.brigadier.tree.LiteralCommandNode<?> node)
command.
Additionally applies the CraftBukkit SuggestionProvider
to all arguments within the node, so ASK_SERVER suggestions can continue
to function for the command.
command - the command to read aliases fromnode - the argument datadefault void register(org.bukkit.command.Command command,
com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder)
command.
Additionally applies the CraftBukkit SuggestionProvider
to all arguments within the node, so ASK_SERVER suggestions can continue
to function for the command.
command - the command to read aliases fromargumentBuilder - the argument data, in a builder formvoid register(com.mojang.brigadier.tree.LiteralCommandNode<?> node)
Equivalent to calling
CommandDispatcher.register(LiteralArgumentBuilder).
Prefer using register(Command, LiteralCommandNode).
node - the argument datadefault void register(com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder)
Equivalent to calling
CommandDispatcher.register(LiteralArgumentBuilder).
Prefer using register(Command, LiteralArgumentBuilder).
argumentBuilder - the argument datastatic Collection<String> getAliases(org.bukkit.command.Command command)
This will include the main label, as well as defined aliases, and aliases including the fallback prefix added by Bukkit.
command - the commandCopyright © 2020. All rights reserved.