Class SubcommandHelpNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>

  • All Implemented Interfaces:
    CommandNode<T>

    public class SubcommandHelpNode<T extends me.lucyy.squirtgun.platform.audience.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 Detail

      • SubcommandHelpNode

        public SubcommandHelpNode​(SubcommandNode<?> parentNode)
    • Method Detail

      • getArguments

        @NotNull
        public @NotNull java.util.List<CommandArgument<?>> getArguments()
        Description copied from interface: CommandNode
        Gets this command's arguments. By default, returns an empty list.
        Specified by:
        getArguments in interface CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Description copied from interface: CommandNode
        Gets this node's name, which will be used as a literal if needed.
        Specified by:
        getName in interface CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: CommandNode
        Gets this node's description for use in help commands. This should be a simple, one-line sentence.
        Specified by:
        getDescription in interface CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
      • next

        @Nullable
        public @Nullable CommandNode<T> next​(CommandContext<T> context)
        Description copied from interface: CommandNode
        Returns the node following this node.
        Specified by:
        next in interface CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
        Returns:
        the next node in the chain, or if this is the end of the chain, null
      • execute

        @Nullable
        public @Nullable net.kyori.adventure.text.Component execute​(CommandContext<T> context)
        Description copied from interface: CommandNode
        Execute this node. This will only be executed if there are no further nodes in the chain.
        Specified by:
        execute in interface CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
        Parameters:
        context - the context that this command was executed in
        Returns:
        a component to optionally