Class StandaloneCommandManager
java.lang.Object
io.github.projectunified.craftcommand.CommandManager<Object>
io.github.projectunified.craftcommand.standalone.StandaloneCommandManager
CommandManager implementation for standalone applications.
Handles registration and retrieval of standalone commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCommand(String label) Gets a registered command by its label or alias.Gets all registered commands.voidhandleException(Object sender, Exception exception) Handles an exception thrown by a command.voidRegisters a command.voidregisterCommand(StandaloneCommand command) Registers a StandaloneCommand instance and its aliases.protected voidsendMessage(Object sender, String message) Sends an already formatted message.Methods inherited from class io.github.projectunified.craftcommand.CommandManager
filterSuggestions, formatMessage, getCommandInfo, getResolver, instantiateWrapper, registerProvider, registerResolver, registerSenderResolver, registerWrapper, resolveParameter, resolveSender, sendMessage
-
Constructor Details
-
StandaloneCommandManager
public StandaloneCommandManager()
-
-
Method Details
-
sendMessage
Description copied from class:CommandManagerSends an already formatted message. Implemented by each platform manager.- Specified by:
sendMessagein classCommandManager<Object>- Parameters:
sender- the message recipientmessage- the formatted message
-
handleException
Description copied from class:CommandManagerHandles an exception thrown by a command. Default: send its message.- Overrides:
handleExceptionin classCommandManager<Object>- Parameters:
sender- the command senderexception- the exception
-
register
Description copied from class:CommandManagerRegisters a command.- Specified by:
registerin classCommandManager<Object>
-
registerCommand
Registers a StandaloneCommand instance and its aliases.- Parameters:
command- the standalone command instance
-
getCommand
Gets a registered command by its label or alias.- Parameters:
label- the command label or alias- Returns:
- the command instance, or
nullif not found
-
getCommands
Gets all registered commands.- Returns:
- an unmodifiable map of command labels to command instances
-