CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
Represents a suggestion for an argument with a hover tooltip text for that suggestion. More...
Public Member Functions | |
String | getSuggestion () |
Returns the current suggestion that this class holds. More... | |
Message | getTooltip () |
Returns the current tooltip text that this class holds. More... | |
Static Public Member Functions | |
static StringTooltip | ofString (String suggestion, String tooltip) |
Constructs a StringTooltip with a suggestion and a string tooltip. More... | |
static StringTooltip | ofMessage (String suggestion, Message tooltip) |
Constructs a StringTooltip with a suggestion and a formatted tooltip. More... | |
static StringTooltip | none (String suggestion) |
Constructs a StringTooltip with a suggestion and no tooltip. More... | |
static Collection< StringTooltip > | none (String... suggestions) |
Constructs a collection of StringTooltip objects from an array of suggestions, and no tooltips. More... | |
static Collection< StringTooltip > | none (Collection< String > suggestions) |
Constructs a collection of StringTooltip objects from a collection of suggestions, and no tooltips. More... | |
static Collection< StringTooltip > | generateStrings (UnaryOperator< String > tooltipGenerator, String... suggestions) |
Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a string tooltip for each suggestion. More... | |
static Collection< StringTooltip > | generateStrings (UnaryOperator< String > tooltipGenerator, Collection< String > suggestions) |
Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion. More... | |
static Collection< StringTooltip > | generateMessages (Function< String, Message > tooltipGenerator, String... suggestions) |
Constructs a collection of StringTooltip objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion. More... | |
static Collection< StringTooltip > | generateMessages (Function< String, Message > tooltipGenerator, Collection< String > suggestions) |
Constructs a collection of StringTooltip objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion. More... | |
Protected Member Functions | |
StringTooltip (String suggestion, Message tooltip) | |
Static Protected Member Functions | |
static< T > Collection< StringTooltip > | generate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, String... suggestions) |
Internal base method for the other generation types. More... | |
static< T > Collection< StringTooltip > | generate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, Collection< String > suggestions) |
Internal base method for the other generation types. More... | |
static< T > Collection< StringTooltip > | generate (Function< String, T > tooltipGenerator, BiFunction< String, T, StringTooltip > tooltipWrapper, Stream< String > suggestions) |
Internal base method for the other generation types. More... | |
Represents a suggestion for an argument with a hover tooltip text for that suggestion.
This class is to be used with normal suggestion overrides, via the Argument.overrideSuggestionsT
method.
|
staticprotected |
Internal base method for the other generation types.
<T> | the type of the tooltip |
tooltipGenerator | tooltip generation function |
tooltipWrapper | function which wraps suggestion and tooltip into a StringTooltip object |
suggestions | collection of suggestions to provide to the user |
StringTooltip
objects from the provided suggestion, wrapped using the above functions
|
staticprotected |
Internal base method for the other generation types.
<T> | the type of the tooltip |
tooltipGenerator | tooltip generation function |
tooltipWrapper | function which wraps suggestion and tooltip into a StringTooltip object |
suggestions | stream of suggestions to provide to the user |
StringTooltip
objects from the provided suggestion, wrapped using the above functions
|
staticprotected |
Internal base method for the other generation types.
<T> | the type of the tooltip |
tooltipGenerator | tooltip generation function |
tooltipWrapper | function which wraps suggestion and tooltip into a StringTooltip object |
suggestions | array of suggestions to provide to the user |
StringTooltip
objects from the provided suggestion, wrapped using the above functions
|
static |
Constructs a collection of StringTooltip
objects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion.
tooltipGenerator | function which returns a formatted tooltip for the suggestion |
suggestions | collection of suggestions to provide to the user |
StringTooltip
objects from the provided suggestions, with the generated formatted tooltips
|
static |
Constructs a collection of StringTooltip
objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion.
tooltipGenerator | function which returns a formatted tooltip for the suggestion |
suggestions | array of suggestions to provide to the user |
StringTooltip
objects from the provided suggestions, with the generated formatted tooltips
|
static |
Constructs a collection of StringTooltip
objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion.
tooltipGenerator | function which returns a string tooltip for the suggestion |
suggestions | collection of suggestions to provide to the user |
StringTooltip
objects from the provided suggestions, with the generated string tooltips
|
static |
Constructs a collection of StringTooltip
objects from an array of suggestions, and a function which generates a string tooltip for each suggestion.
tooltipGenerator | function which returns a string tooltip for the suggestion |
suggestions | array of suggestions to provide to the user |
StringTooltip
objects from the provided suggestions, with the generated string tooltips String dev.jorel.commandapi.StringTooltip.getSuggestion | ( | ) |
Returns the current suggestion that this class holds.
Implements dev.jorel.commandapi.IStringTooltip.
Message dev.jorel.commandapi.StringTooltip.getTooltip | ( | ) |
Returns the current tooltip text that this class holds.
Implements dev.jorel.commandapi.IStringTooltip.
|
static |
Constructs a collection of StringTooltip
objects from a collection of suggestions, and no tooltips.
suggestions | collection of suggestions to provide to the user |
StringTooltip
objects from the suggestions, with no tooltips
|
static |
Constructs a StringTooltip with a suggestion and no tooltip.
suggestion | the suggestion to provide to the user |
|
static |
Constructs a collection of StringTooltip
objects from an array of suggestions, and no tooltips.
suggestions | array of suggestions to provide to the user |
StringTooltip
objects from the suggestions, with no tooltips
|
static |
Constructs a StringTooltip with a suggestion and a formatted tooltip.
suggestion | the suggestion to provide to the user |
tooltip | the formatted tooltip to show to the user when they hover over the suggestion |
|
static |
Constructs a StringTooltip with a suggestion and a string tooltip.
suggestion | the suggestion to provide to the user |
tooltip | the string tooltip to show to the user when they hover over the suggestion |