Package me.croabeast.common.reflect
Class Craft.Command.Dispatcher
java.lang.Object
me.croabeast.common.reflect.Craft.Command.Dispatcher
- Enclosing class:
Craft.Command
Contains methods for interacting with the command dispatcher.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRoot()Retrieves the root node of the command dispatcher.voidremoveCommands(Collection<String> collection) Removes commands from the root command node that match the provided collection of names.
-
Field Details
-
INSTANCE
A singletonReflectorinstance for the command dispatcher.Depending on the server version, it loads either the modern or legacy command dispatcher. For server versions below 13.0, this instance is
null.
-
-
Constructor Details
-
Dispatcher
public Dispatcher()
-
-
Method Details
-
removeCommands
Removes commands from the root command node that match the provided collection of names.- Parameters:
collection- a collection of command names to remove
-
getRoot
Retrieves the root node of the command dispatcher.- Returns:
- the root
Craft.Command.Nodeof the command dispatcher, ornullif unavailable - Throws:
Exception- if an error occurs during reflection
-