Package me.hackware.api.command
Class CommandHandler
java.lang.Object
me.hackware.api.command.CommandHandler
Singleton command manager. Handles dispatching chat input to registered
commands and providing tab-completion suggestions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidInstalled once by the client at startup.booleanAttempt to handle a chat message as a command.static CommandHandlerget()The prefix lives on the ClickGUI module (persisted in its config file).getSuggestions(String input) Get tab-completion suggestions for the current chat input.voidvoidvoidunregister(Command command) Removes a command — used to roll back a plugin's commands on unload.
-
Method Details
-
bootstrap
Installed once by the client at startup. -
get
-
unregister
Removes a command — used to roll back a plugin's commands on unload. -
register
-
getCommands
-
getPrefix
The prefix lives on the ClickGUI module (persisted in its config file). -
setPrefix
-
dispatch
Attempt to handle a chat message as a command.- Parameters:
message- the raw chat message (without leading /)- Returns:
- true if the message was handled as a command, false otherwise
-
getSuggestions
Get tab-completion suggestions for the current chat input.- Parameters:
input- the full chat input string- Returns:
- list of full suggestion strings (including prefix)
-