Class CommandEngine
java.lang.Object
com.ultikits.ultitools.command.engine.CommandEngine
Internal cross-package facade; all tree and binding details stay in this package.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommandBindingsprivate final CommandTreeCompilerprivate final LifecycleCommandInstallerprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionCreates the Paper-backed engine.CommandEngine(NativeArgumentTypes types, Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases module, external and framework bindings together.ownerByLabel(String label) Resolves ownership through a primary label, alias or namespaced spelling.booleanregister(Object owner, String ownerName, BaseCommandExecutor executor, String description, String permission, boolean requireOp, List<String> aliases) Registers an annotation executor under its owner without accessing Paper's dispatcher.booleanregister(Object owner, String ownerName, BrigadierCommand command) Registers a module-provided Brigadier tree with the same ownership lifecycle.voidInstalls the framework listener once during enable, independently of command registration.voidunregister(Object owner) Releases only the specified owner's commands.
-
Field Details
-
bindings
-
compiler
-
installer
-
listenerInstalled
private boolean listenerInstalled
-
-
Constructor Details
-
CommandEngine
public CommandEngine()Creates the Paper-backed engine. -
CommandEngine
CommandEngine(NativeArgumentTypes types, Logger logger)
-
-
Method Details
-
register
public boolean register(Object owner, String ownerName, BaseCommandExecutor executor, String description, String permission, boolean requireOp, List<String> aliases) Registers an annotation executor under its owner without accessing Paper's dispatcher.- Parameters:
owner- the ownership tokenownerName- the diagnostic nameexecutor- the live executordescription- the resolved descriptionpermission- the root permissionrequireOp- the root operator requirementaliases- the root label followed by its aliases- Returns:
- whether ownership accepted the command
-
registerInternalListeners
public void registerInternalListeners()Installs the framework listener once during enable, independently of command registration. -
register
Registers a module-provided Brigadier tree with the same ownership lifecycle.- Parameters:
owner- the ownership tokenownerName- the diagnostic namecommand- the hand-written command bean- Returns:
- whether ownership accepted the command
-
unregister
Releases only the specified owner's commands.- Parameters:
owner- the ownership token
-
close
public void close()Releases module, external and framework bindings together. -
ownerByLabel
-