Class CommandGroup
java.lang.Object
com.github.pinont.singularitylib.api.command.CommandGroup
- All Implemented Interfaces:
SimpleCommand, io.papermc.paper.command.brigadier.BasicCommand
A command that groups
SubCommands under one root label, with an
auto-generated help menu when invoked with no arguments.
Consumers create a subclass, register subcommands in the constructor, and
register the group via CommandManager (or registerComponents()).
CommandGroup arena = new CommandGroup() {
{
registerSubcommand(new ArenaCreateSub());
registerSubcommand(new ArenaDeleteSub());
}
};
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDispatches to subcommands using a plain CommandSender (console-friendly and unit-testable without a CommandSourceStack).protected StringgetUsageHint(String unknown) final voidRegisters a subcommand (also registers its aliases vianame:alias).voidsendHelp(org.bukkit.command.CommandSender sender) Sends the paginated help listing to the sender.Gets the usage string for this command.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.papermc.paper.command.brigadier.BasicCommand
canUse, permission, suggestMethods inherited from interface SimpleCommand
getName
-
Constructor Details
-
CommandGroup
public CommandGroup()
-
-
Method Details
-
registerSubcommand
Registers a subcommand (also registers its aliases vianame:alias). -
getSubcommandNames
-
execute
- Specified by:
executein interfaceio.papermc.paper.command.brigadier.BasicCommand
-
execute
Dispatches to subcommands using a plain CommandSender (console-friendly and unit-testable without a CommandSourceStack). -
getUsageHint
-
sendHelp
public void sendHelp(org.bukkit.command.CommandSender sender) Sends the paginated help listing to the sender. -
usage
Description copied from interface:SimpleCommandGets the usage string for this command.- Specified by:
usagein interfaceSimpleCommand- Parameters:
bool- unused parameter for compatibility- Returns:
- the usage string for this command
-