mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 11:54:39 +01:00
Generic help command
This commit is contained in:
@@ -63,6 +63,23 @@ public final class CommandMap {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all registered commands.
|
||||
* @return All command handlers as a list.
|
||||
*/
|
||||
public List<CommandHandler> getHandlers() {
|
||||
return new LinkedList<>(this.commands.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a handler by label/alias.
|
||||
* @param label The command label.
|
||||
* @return The command handler.
|
||||
*/
|
||||
public CommandHandler getHandler(String label) {
|
||||
return this.commands.get(label);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke a command handler with the given arguments.
|
||||
* @param player The player invoking the command or null for the server console.
|
||||
|
||||
Reference in New Issue
Block a user