Class BrigadierSubCommandBuilder
java.lang.Object
me.tayebyassine.homestead.commands.brigadier.builder.BrigadierSubCommandBuilder
A single literal node (and its optional arguments and nested literals) of a Brigadier command tree.
Instances are obtained through BrigadierCommandBuilder.literalSub(String).
-
Method Summary
Modifier and TypeMethodDescriptionend()Ends the current chain and returns the rootBrigadierCommandBuilder.Ends a nested literal and returns its parent node.greedyStringArg(String name) Appends a greedy string argument (consumes the remainder of the input).Appends an integer argument.Appends an integer argument restricted to the given range (inclusive).literalSub(String name) Appends a nested literal to this node.Appends a free-form string argument.
-
Method Details
-
stringArg
Appends a free-form string argument.- Parameters:
name- the argument name- Returns:
- this node, for chaining
-
greedyStringArg
Appends a greedy string argument (consumes the remainder of the input).- Parameters:
name- the argument name- Returns:
- this node, for chaining
-
intArg
Appends an integer argument.- Parameters:
name- the argument name- Returns:
- this node, for chaining
-
intArg
Appends an integer argument restricted to the given range (inclusive).- Parameters:
name- the argument namemin- the minimum allowed valuemax- the maximum allowed value- Returns:
- this node, for chaining
-
literalSub
Appends a nested literal to this node.- Parameters:
name- the literal name- Returns:
- the nested node
-
end
Ends the current chain and returns the rootBrigadierCommandBuilder.- Returns:
- the root builder
-
endNested
Ends a nested literal and returns its parent node.- Returns:
- the parent node
-