Class SubcommandHelpNode
java.lang.Object
net.lucypoulton.squirtgun.command.node.subcommand.SubcommandHelpNode
- All Implemented Interfaces:
CommandNode<PermissionHolder>
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 -
Method Summary
Modifier and TypeMethodDescription@Nullable net.kyori.adventure.text.Componentexecute(CommandContext context)Execute this node.@NotNull List<CommandArgument<?>>Gets this command's arguments.@NotNull Condition<PermissionHolder,? extends PermissionHolder>Gets the condition needed to execute this node or any children.Gets this node's description for use in help commands.@NotNull StringgetName()Gets this node's name, which will be used as a literal if needed.@Nullable CommandNode<?>next(CommandContext 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 net.lucypoulton.squirtgun.command.node.CommandNode
withExtraCondition
-
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<PermissionHolder>
-
getName
Description copied from interface:CommandNodeGets this node's name, which will be used as a literal if needed.- Specified by:
getNamein interfaceCommandNode<PermissionHolder>
-
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<PermissionHolder>
-
getCondition
Description copied from interface:CommandNodeGets the condition needed to execute this node or any children. If not needed, use PermissionHolder as T and returnCondition.alwaysTrue()- Specified by:
getConditionin interfaceCommandNode<PermissionHolder>- Returns:
- the condition
-
next
Description copied from interface:CommandNodeReturns the node following this node.- Specified by:
nextin interfaceCommandNode<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<PermissionHolder>- Parameters:
context- the context that this command was executed in- Returns:
- a component to optionally
-