CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
This class represents a branch in the suggestions of an argument. More...
Public Member Functions | |
final SuggestionsBranch< CommandSender > | branch (SuggestionsBranch< CommandSender >... branches) |
Adds further branches to this SuggestionsBranch . More... | |
ArgumentSuggestions< CommandSender > | getNextSuggestion (CommandSender sender, String... previousArguments) throws CommandSyntaxException |
Gets the next ArgumentSuggestions based on the previous arguments. More... | |
void | enforceReplacements (CommandSender sender, String... arguments) throws CommandSyntaxException |
Makes sure the given arguments correspond to the suggestions of this SuggestionsBranch . More... | |
Static Public Member Functions | |
static< CommandSender > SuggestionsBranch< CommandSender > | suggest (ArgumentSuggestions< CommandSender >... suggestions) |
Creates a SuggestionsBranch starting with the given suggestions. More... | |
This class represents a branch in the suggestions of an argument.
Use SuggestionsBranch#suggest(ArgumentSuggestions...)
to add suggestions, then SuggestionsBranch#branch(SuggestionsBranch...)
to add more branches.
final SuggestionsBranch< CommandSender > dev.jorel.commandapi.arguments.SuggestionsBranch< CommandSender >.branch | ( | SuggestionsBranch< CommandSender >... | branches | ) |
Adds further branches to this SuggestionsBranch
.
After going through the suggestions provided by SuggestionsBranch#suggest(ArgumentSuggestions...)
the suggestions of these branches will be used.
branches | An array of SuggestionsBranch representing the branching suggestions. Use SuggestionsBranch#suggest(ArgumentSuggestions...) to start creating these. |
SuggestionsBranch
void dev.jorel.commandapi.arguments.SuggestionsBranch< CommandSender >.enforceReplacements | ( | CommandSender | sender, |
String... | arguments | ||
) | throws CommandSyntaxException |
Makes sure the given arguments correspond to the suggestions of this SuggestionsBranch
.
sender | The CommandSender the suggestions are being built for |
arguments | An array of arguments to check against the suggestions of this SuggestionsBranch |
CommandSyntaxException | if the given arguments don't lead to a valid path for this SuggestionsBranch |
ArgumentSuggestions< CommandSender > dev.jorel.commandapi.arguments.SuggestionsBranch< CommandSender >.getNextSuggestion | ( | CommandSender | sender, |
String... | previousArguments | ||
) | throws CommandSyntaxException |
Gets the next ArgumentSuggestions
based on the previous arguments.
sender | The CommandSender the suggestions are being built for |
previousArguments | An array of previously given arguments that is used to find the next ArgumentSuggestions |
ArgumentSuggestions
given by this SuggestionsBranch
or null if the suggestions should not be overridden CommandSyntaxException | if the given previous arguments don't lead to a valid path for this SuggestionsBranch |
|
static |
Creates a SuggestionsBranch
starting with the given suggestions.
If a suggestions is null, the suggestions at that position will not be overridden.
suggestions | An array of ArgumentSuggestions representing the suggestions. Use the static methods in ArgumentSuggestions to create these. |
SuggestionsBranch
starting with the given suggestions