Class CommandManager

java.lang.Object
com.ultikits.ultitools.manager.CommandManager

public class CommandManager extends Object
Owns annotation command registrations without reflecting into Bukkit internals.
  • Field Details

  • Constructor Details

    • CommandManager

      public CommandManager()
      Creates the Paper-backed command manager.
    • CommandManager

      @Internal public CommandManager(CommandEngine engine)
      Internal constructor for an explicitly supplied engine.
      Parameters:
      engine - the command engine
  • Method Details

    • register

      public void register(UltiToolsPlugin plugin, Class<? extends BaseCommandExecutor> clazz, String permission, String description, String... aliases)
      Registers an executor obtained from its module's own container.
      Parameters:
      plugin - the owning module
      clazz - the executor class
      permission - the root permission
      description - the untranslated description
      aliases - the primary label followed by aliases
    • register

      public void register(UltiToolsPlugin plugin, Class<? extends BaseCommandExecutor> clazz)
      Registers a manually managed annotation executor from the module container.
      Parameters:
      plugin - the owning module
      clazz - the executor class
    • registerAll

      public void registerAll(UltiToolsPlugin plugin)
      Registers eligible module executors once per bean identity.
      Parameters:
      plugin - the owning module
    • getPluginByLabel

      @Nullable public @Nullable UltiToolsPlugin getPluginByLabel(String label)
      Resolves module ownership by label, including aliases.
      Parameters:
      label - the root label
      Returns:
      the owning module, or null for core/external/unbound commands
    • unregisterAll

      public void unregisterAll(UltiToolsPlugin plugin)
      Hides a module's existing proxy trees and releases their live instances.
      Parameters:
      plugin - the owning module
    • registerInternalListeners

      @Internal public void registerInternalListeners()
      Installs command event recovery beside the framework's other enable-time listeners.
    • close

      public void close()
      Releases all live command bindings.
    • awaitCoreAsyncCommands

      @Internal public void awaitCoreAsyncCommands()
      Drains explicitly registered core executors before any framework service shuts down.
    • registerCoreCommand

      public void registerCoreCommand(BaseCommandExecutor executor)
      Registers a framework-owned command during enable.
      Parameters:
      executor - the executor
    • registerAllExternal

      public void registerAllExternal(ExternalPluginAdapter adapter)
      Registers external executors once per bean identity, using raw descriptions.
      Parameters:
      adapter - the external plugin adapter
    • registerBeans

      private void registerBeans(Object owner, String ownerName, SimpleContainer context, UltiToolsPlugin module)
    • unregisterAllExternal

      public void unregisterAllExternal(String pluginName)
      Releases only this external plugin's command bindings.
      Parameters:
      pluginName - the external owner name
    • registerExecutor

      private void registerExecutor(Object owner, String ownerName, BaseCommandExecutor executor, UltiToolsPlugin module)
    • moduleDescription

      private static String moduleDescription(UltiToolsPlugin module, String description)
    • registerOwned

      private void registerOwned(Object owner, String ownerName, Object executor, Runnable registration)
    • annotation

      @Nullable private static @Nullable CmdExecutor annotation(BaseCommandExecutor executor)