Class BaseCommand
java.lang.Object
net.guizhanss.guizhanlib.minecraft.commands.AbstractCommand
net.guizhanss.guizhanlib.minecraft.commands.BaseCommand
- All Implemented Interfaces:
CommandExecutor,TabCompleter
The
BaseCommand is the root node of a command tree.
It has no parent node, and is CommandExecutor and TabCompleter.
Be sure to call register() after creating a new instance of this class.
- Author:
- ybw0014
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCommand(PluginCommand command, BiFunction<AbstractCommand, CommandSender, String> description, String usage, SubCommand... subCommands) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanonCommand(CommandSender sender, Command command, String label, String[] args) onTabComplete(CommandSender sender, Command command, String label, String[] args) voidregister()Register this command.Methods inherited from class net.guizhanss.guizhanlib.minecraft.commands.AbstractCommand
addSubCommand, getFullUsage, hasParent, hasSubCommands, onCommandExecute, onExecute, onTab, onTabCompleteExecute, sendHelp
-
Constructor Details
-
BaseCommand
@ParametersAreNonnullByDefault protected BaseCommand(PluginCommand command, BiFunction<AbstractCommand, CommandSender, String> description, String usage, SubCommand... subCommands)
-
-
Method Details
-
onCommand
@ParametersAreNonnullByDefault public final boolean onCommand(CommandSender sender, Command command, String label, String[] args) - Specified by:
onCommandin interfaceCommandExecutor
-
onTabComplete
@Nullable @ParametersAreNonnullByDefault public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) - Specified by:
onTabCompletein interfaceTabCompleter
-
register
public void register()Register this command.
-