CommandAPI 9.5.2
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.SpigotCommandRegistration< Source > Class Template Reference

Handles logic for registering commands on Spigot and old versions of Paper. More...

+ Inheritance diagram for dev.jorel.commandapi.SpigotCommandRegistration< Source >:

Public Member Functions

 SpigotCommandRegistration (CommandDispatcher< Source > brigadierDispatcher, SimpleCommandMap commandMap, Supplier< CommandDispatcher< Source > > getResourcesDispatcher, Predicate< Command > isVanillaCommandWrapper, Function< CommandNode< Source >, Command > wrapToVanillaCommandWrapper, Predicate< CommandNode< Source > > isBukkitCommandWrapper)
 
CommandDispatcher< Source > getResourcesDispatcher ()
 Returns the Brigadier CommandDispatcher used when commands are sent to Players. More...
 
boolean isVanillaCommandWrapper (Command command)
 Checks if a Command is an instance of the OBC VanillaCommandWrapper. More...
 
Command wrapToVanillaCommandWrapper (CommandNode< Source > node)
 Wraps a Brigadier command node as Bukkit's VanillaCommandWrapper. More...
 
boolean isBukkitCommandWrapper (CommandNode< Source > node)
 Checks if a Brigadier command node is being handled by Bukkit's BukkitCommandWrapper. More...
 
CommandDispatcher< Source > getBrigadierDispatcher ()
 
void runTasksAfterServerStart ()
 
void postCommandRegistration (RegisteredCommand registeredCommand, LiteralCommandNode< Source > resultantNode, List< LiteralCommandNode< Source > > aliasNodes)
 
LiteralCommandNode< Source > registerCommandNode (LiteralArgumentBuilder< Source > node, String namespace)
 
void unregister (String commandName, boolean unregisterNamespaces, boolean unregisterBukkit)
 
void preReloadDataPacks ()
 

Protected Member Functions

void removeBrigadierCommands (RootCommandNode< Source > root, String commandName, boolean unregisterNamespaces, Predicate< CommandNode< Source > > extraCheck)
 

Static Protected Member Functions

static< T > void removeCommandNamespace (Map< String, T > map, String commandName, Predicate< T > extraCheck)
 
static< T > void removeCommandFromMapIfCheckPasses (Map< String, T > map, String key, Predicate< T > extraCheck)
 
static boolean isThisTheCommandButNamespaced (String commandName, String key)
 

Detailed Description

Handles logic for registering commands on Spigot and old versions of Paper.

Member Function Documentation

◆ getBrigadierDispatcher()

◆ getResourcesDispatcher()

CommandDispatcher< Source > dev.jorel.commandapi.SpigotCommandRegistration< Source >.getResourcesDispatcher ( )

Returns the Brigadier CommandDispatcher used when commands are sent to Players.

Returns
A Brigadier CommandDispatcher

◆ isBukkitCommandWrapper()

boolean dev.jorel.commandapi.SpigotCommandRegistration< Source >.isBukkitCommandWrapper ( CommandNode< Source >  node)

Checks if a Brigadier command node is being handled by Bukkit's BukkitCommandWrapper.

Parameters
nodeThe CommandNode to check
Returns
true if the CommandNode is being handled by Bukkit's BukkitCommandWrapper

◆ isVanillaCommandWrapper()

boolean dev.jorel.commandapi.SpigotCommandRegistration< Source >.isVanillaCommandWrapper ( Command  command)

Checks if a Command is an instance of the OBC VanillaCommandWrapper.

Parameters
commandThe Command to check
Returns
true if Command is an instance of VanillaCommandWrapper

◆ postCommandRegistration()

void dev.jorel.commandapi.SpigotCommandRegistration< Source >.postCommandRegistration ( RegisteredCommand  registeredCommand,
LiteralCommandNode< Source >  resultantNode,
List< LiteralCommandNode< Source > >  aliasNodes 
)

◆ preReloadDataPacks()

◆ registerCommandNode()

LiteralCommandNode< Source > dev.jorel.commandapi.SpigotCommandRegistration< Source >.registerCommandNode ( LiteralArgumentBuilder< Source >  node,
String  namespace 
)

◆ runTasksAfterServerStart()

◆ unregister()

void dev.jorel.commandapi.SpigotCommandRegistration< Source >.unregister ( String  commandName,
boolean  unregisterNamespaces,
boolean  unregisterBukkit 
)

◆ wrapToVanillaCommandWrapper()

Command dev.jorel.commandapi.SpigotCommandRegistration< Source >.wrapToVanillaCommandWrapper ( CommandNode< Source >  node)

Wraps a Brigadier command node as Bukkit's VanillaCommandWrapper.

Parameters
nodeThe LiteralCommandNode to wrap
Returns
A VanillaCommandWrapper representing the given node