Class Craft.Command.Dispatcher

java.lang.Object
me.croabeast.common.reflect.Craft.Command.Dispatcher
Enclosing class:
Craft.Command

public static class Craft.Command.Dispatcher extends Object
Contains methods for interacting with the command dispatcher.
  • Field Details

    • INSTANCE

      @Nullable public final @Nullable Reflector INSTANCE
      A singleton Reflector instance 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

      public void removeCommands(Collection<String> collection)
      Removes commands from the root command node that match the provided collection of names.
      Parameters:
      collection - a collection of command names to remove
    • getRoot

      public Craft.Command.Node getRoot()
      Retrieves the root node of the command dispatcher.
      Returns:
      the root Craft.Command.Node of the command dispatcher, or null if unavailable
      Throws:
      Exception - if an error occurs during reflection