Package me.lucyy.squirtgun.command.node
Class SubcommandHelpNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>
java.lang.Object
me.lucyy.squirtgun.command.node.SubcommandHelpNode<T>
- All Implemented Interfaces:
CommandNode<T>
public class SubcommandHelpNode<T extends me.lucyy.squirtgun.platform.PermissionHolder> extends java.lang.Object implements CommandNode<T>
A help node for a subcommand.
One optional argument is exposed, which determines a specific child node to show help for.
If specified, a new
HelpNode will be created for it and the output shown, otherwise
a general overview of the command and its subnodes will be shown.- Since:
- 2.0.0
-
Constructor Summary
Constructors Constructor Description SubcommandHelpNode(SubcommandNode<?> parentNode) -
Method Summary
Modifier and Type Method Description @Nullable net.kyori.adventure.text.Componentexecute(CommandContext<T> context)Execute this node.@NotNull java.util.List<CommandArgument<?>>getArguments()Gets this command's arguments.java.lang.StringgetDescription()Gets this node's description for use in help commands.@NotNull java.lang.StringgetName()Gets this node's name, which will be used as a literal if needed.@Nullable CommandNode<T>next(CommandContext<T> context)Returns the node following this node.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.lucyy.squirtgun.command.node.CommandNode
getPermission
-
Constructor Details
-
SubcommandHelpNode
-
-
Method Details
-
getArguments
Description copied from interface:CommandNodeGets this command's arguments. By default, returns an empty list.- Specified by:
getArgumentsin interfaceCommandNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
getName
@NotNull public @NotNull java.lang.String getName()Description copied from interface:CommandNodeGets this node's name, which will be used as a literal if needed.- Specified by:
getNamein interfaceCommandNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
getDescription
public java.lang.String getDescription()Description copied from interface:CommandNodeGets this node's description for use in help commands. This should be a simple, one-line sentence.- Specified by:
getDescriptionin interfaceCommandNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>
-
next
Description copied from interface:CommandNodeReturns the node following this node.- Specified by:
nextin interfaceCommandNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>- Returns:
- the next node in the chain, or if this is the end of the chain, null
-
execute
Description copied from interface:CommandNodeExecute this node. This will only be executed if there are no further nodes in the chain.- Specified by:
executein interfaceCommandNode<T extends me.lucyy.squirtgun.platform.PermissionHolder>- Parameters:
context- the context that this command was executed in- Returns:
- a component to optionally
-