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.
|
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 . |
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 . |
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 instace) every time new plugins are loaded.
List<com.mojang.brigadier.tree.LiteralCommandNode<?>> getRegisteredNodes()
CommandDispatcher
by
this instance.
Bear in mind that registrations are pushed to the dispatcher with a 1 tick delay. Nodes will not appear in this list until they have actually been registered.
void register(com.mojang.brigadier.tree.LiteralCommandNode<?> node)
Equivalent to calling
CommandDispatcher.register(LiteralArgumentBuilder)
.
The registration action occurs after a delay of one tick. This is because the dispatcher instance is completely replaced after all plugins have been loaded.
node
- the argument datadefault void register(com.mojang.brigadier.builder.LiteralArgumentBuilder<?> argumentBuilder)
Equivalent to calling
CommandDispatcher.register(LiteralArgumentBuilder)
.
The registration action occurs after a delay of one tick. This is because the dispatcher instance is completely replaced after all plugins have been loaded.
argumentBuilder
- the argument datavoid register(org.bukkit.command.Command command, com.mojang.brigadier.tree.LiteralCommandNode<?> node)
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
.command
- the command to read aliases fromargumentBuilder
- the argument data, in a builder formstatic 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 © 2019. All rights reserved.