Class CommandManager
java.lang.Object
com.ultikits.ultitools.manager.CommandManager
Owns annotation command registrations without reflecting into Bukkit internals.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final List<BaseCommandExecutor> private final CommandEngine -
Constructor Summary
ConstructorsConstructorDescriptionCreates the Paper-backed command manager.CommandManager(CommandEngine engine) Internal constructor for an explicitly supplied engine. -
Method Summary
Modifier and TypeMethodDescriptionprivate static @Nullable CmdExecutorannotation(BaseCommandExecutor executor) voidDrains explicitly registered core executors before any framework service shuts down.voidclose()Releases all live command bindings.@Nullable UltiToolsPlugingetPluginByLabel(String label) Resolves module ownership by label, including aliases.private static StringmoduleDescription(UltiToolsPlugin module, String description) voidregister(UltiToolsPlugin plugin, Class<? extends BaseCommandExecutor> clazz) Registers a manually managed annotation executor from the module container.voidregister(UltiToolsPlugin plugin, Class<? extends BaseCommandExecutor> clazz, String permission, String description, String... aliases) Registers an executor obtained from its module's own container.voidregisterAll(UltiToolsPlugin plugin) Registers eligible module executors once per bean identity.voidregisterAllExternal(ExternalPluginAdapter adapter) Registers external executors once per bean identity, using raw descriptions.private voidregisterBeans(Object owner, String ownerName, SimpleContainer context, UltiToolsPlugin module) voidregisterCoreCommand(BaseCommandExecutor executor) Registers a framework-owned command during enable.private voidregisterExecutor(Object owner, String ownerName, BaseCommandExecutor executor, UltiToolsPlugin module) voidInstalls command event recovery beside the framework's other enable-time listeners.private voidregisterOwned(Object owner, String ownerName, Object executor, Runnable registration) voidunregisterAll(UltiToolsPlugin plugin) Hides a module's existing proxy trees and releases their live instances.voidunregisterAllExternal(String pluginName) Releases only this external plugin's command bindings.
-
Field Details
-
CORE_OWNER
- See Also:
-
engine
-
coreExecutors
-
-
Constructor Details
-
CommandManager
public CommandManager()Creates the Paper-backed command manager. -
CommandManager
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 moduleclazz- the executor classpermission- the root permissiondescription- the untranslated descriptionaliases- the primary label followed by aliases
-
register
Registers a manually managed annotation executor from the module container.- Parameters:
plugin- the owning moduleclazz- the executor class
-
registerAll
Registers eligible module executors once per bean identity.- Parameters:
plugin- the owning module
-
getPluginByLabel
Resolves module ownership by label, including aliases.- Parameters:
label- the root label- Returns:
- the owning module, or null for core/external/unbound commands
-
unregisterAll
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
Registers a framework-owned command during enable.- Parameters:
executor- the executor
-
registerAllExternal
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
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
-
registerOwned
-
annotation
-