CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
|
This class represents a suggestion for an argument with a hover tooltip text for that suggestion. More...
Public Member Functions | |
S | getSuggestion () |
Gets the suggestion for this object. More... | |
Message | getTooltip () |
Gets the formatted tooltip for this object. More... | |
Static Public Member Functions | |
static< S > Collection< Tooltip< S > > | generateBaseComponents (Function< S, BaseComponent[]> tooltipGenerator, S... suggestions) |
Constructs a collection of objects from an array of suggestions, and a function which generates a tooltip formatted as an array of BaseComponent s for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateBaseComponents (Function< S, BaseComponent[]> tooltipGenerator, Collection< S > suggestions) |
Constructs a collection of objects from a collection of suggestions, and a function which generates a tooltip formatted as an array of BaseComponent s for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateAdvenureComponents (Function< S, Component > tooltipGenerator, S... suggestions) |
Constructs a collection of objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateAdventureComponents (Function< S, Component > tooltipGenerator, S... suggestions) |
Constructs a collection of objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateAdvenureComponents (Function< S, Component > tooltipGenerator, Collection< S > suggestions) |
Constructs a collection of objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateAdventureComponents (Function< S, Component > tooltipGenerator, Collection< S > suggestions) |
Constructs a collection of objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component for each suggestion. More... | |
static< S > Tooltip< S > | ofBaseComponents (S object, BaseComponent... tooltip) |
Constructs a BukkitTooltip<S> with a suggestion and a formatted tooltip. More... | |
static< S > Tooltip< S > | ofAdventureComponent (S object, Component tooltip) |
Constructs a BukkitTooltip<S> with a suggestion and a formatted tooltip. More... | |
static Message | messageFromBaseComponents (BaseComponent... components) |
Converts a formatted bungee text component to a native minecraft text component which can be used natively by brigadier. More... | |
static Message | messageFromAdventureComponent (Component component) |
Converts a formatted adventure text component to a native minecraft text component which can be used natively by brigadier. More... | |
static< S > Tooltip< S > | ofString (S object, String tooltip) |
Constructs a Tooltip<S> with a suggestion and a tooltip. More... | |
static< S > Tooltip< S > | ofMessage (S object, Message tooltip) |
Constructs a Tooltip<S> with a suggestion and a tooltip. More... | |
static< S > Tooltip< S > | none (S object) |
Constructs a Tooltip<S> with a suggestion and no tooltip. More... | |
static< S > Collection< Tooltip< S > > | none (S... suggestions) |
Constructs a collection of objects from an array of suggestions, and no tooltips. More... | |
static< S > Collection< Tooltip< S > > | none (Collection< S > suggestions) |
Constructs a collection of objects from a collection of suggestions, and no tooltips. More... | |
static< S > Collection< Tooltip< S > > | generateStrings (Function< S, String > tooltipGenerator, S... suggestions) |
Constructs a collection of objects from an array of suggestions, and a function which generates a string tooltip for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateStrings (Function< S, String > tooltipGenerator, Collection< S > suggestions) |
Constructs a collection of objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateMessages (Function< S, Message > tooltipGenerator, S... suggestions) |
Constructs a collection of objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion. More... | |
static< S > Collection< Tooltip< S > > | generateMessages (Function< S, Message > tooltipGenerator, Collection< S > suggestions) |
Constructs a collection of objects from an collection of suggestions, and a function which generates a formatted tooltip for each suggestion. More... | |
static< S > Tooltip< S >[] | arrayOf (Tooltip< S >... tooltips) |
Constructs a Tooltip<S> [] from an array of Tooltip<S> via varargs. More... | |
static< S > Function< Tooltip< S >, StringTooltip > | build (Function< S, String > mapper) |
Constructs a function that maps the current Tooltip<S> into a StringTooltip, using a standard mapping function which is defined for a given argument. More... | |
static Message | messageFromString (String string) |
Converts an unformatted string to an unformatted tooltip by wrapping as with a LiteralMessage . More... | |
Protected Member Functions | |
BukkitTooltip (S object, Message tooltip) | |
static< S, T > Collection< Tooltip< S > > | generate (Function< S, T > tooltipGenerator, BiFunction< S, T, Tooltip< S > > tooltipWrapper, S... suggestions) |
Internal base method for the other generation types, for processing arrays. More... | |
Static Protected Member Functions | |
static< S, T > Collection< Tooltip< S > > | generate (Function< S, T > tooltipGenerator, BiFunction< S, T, Tooltip< S > > tooltipWrapper, Collection< S > suggestions) |
Internal base method for the other generation types, for processing collections. More... | |
This class represents a suggestion for an argument with a hover tooltip text for that suggestion.
This class is parameterized over some object S that represents the safe cast type for argument suggestions. This class is to be used with safe suggestion overrides, via the SafeOverrideableArgument.safeOverrideSuggestionsT method.
<S> | the object that the argument suggestions use |
|
staticinherited |
Constructs a Tooltip<S>
[] from an array of Tooltip<S>
via varargs.
This method takes advantage of Java's varargs to construct a generic array parameterised over S for the purpose of type safety for the safeOverrideSuggestionsT method, because Java doesn't allow you to create generic arrays.
|
staticinherited |
Constructs a function that maps the current Tooltip<S>
into a StringTooltip, using a standard mapping function which is defined for a given argument.
This method is used internally by the CommandAPI.
<S> | the object that the argument suggestions use |
mapper | a mapping function that converts an S instance into a String |
|
staticprotectedinherited |
Internal base method for the other generation types, for processing collections.
|
protectedinherited |
Internal base method for the other generation types, for processing arrays.
|
static |
Constructs a collection of
objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component
for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an adventure Component |
suggestions | collection of suggestions to provide to the user |
|
static |
Constructs a collection of
objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component
for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an adventure Component |
suggestions | array of suggestions to provide to the user |
|
static |
Constructs a collection of
objects from a collection of suggestions, and a function which generates a tooltip formatted as an adventure Component
for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an adventure Component |
suggestions | collection of suggestions to provide to the user |
BukkitTooltip#generateAdventureComponents(Function, Collection)
|
static |
Constructs a collection of
objects from an array of suggestions, and a function which generates a tooltip formatted as an adventure Component
for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an adventure Component |
suggestions | array of suggestions to provide to the user |
BukkitTooltip#generateAdventureComponents(Function, Object[])
|
static |
Constructs a collection of
objects from a collection of suggestions, and a function which generates a tooltip formatted as an array of BaseComponent
s for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an array of BaseComponent s |
suggestions | collection of suggestions to provide to the user |
|
static |
Constructs a collection of
objects from an array of suggestions, and a function which generates a tooltip formatted as an array of BaseComponent
s for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion, an array of BaseComponent s |
suggestions | array of suggestions to provide to the user |
|
staticinherited |
Constructs a collection of
objects from an collection of suggestions, and a function which generates a formatted tooltip for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion |
suggestions | collection of suggestions to provide to the user |
|
staticinherited |
Constructs a collection of
objects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a formatted tooltip for the suggestion |
suggestions | array of suggestions to provide to the user |
|
staticinherited |
Constructs a collection of
objects from a collection of suggestions, and a function which generates a string tooltip for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a string tooltip for the suggestion |
suggestions | collection of suggestions to provide to the user |
|
staticinherited |
Constructs a collection of
objects from an array of suggestions, and a function which generates a string tooltip for each suggestion.
<S> | the object that the argument suggestions use |
tooltipGenerator | function which returns a string tooltip for the suggestion |
suggestions | array of suggestions to provide to the user |
|
inherited |
Gets the suggestion for this object.
|
inherited |
Gets the formatted tooltip for this object.
|
static |
Converts a formatted adventure text component to a native minecraft text component which can be used natively by brigadier.
This supports all forms of formatting including entity selectors, scores, click & hover events, translations, keybinds and more.
component | adventure text component |
|
static |
Converts a formatted bungee text component to a native minecraft text component which can be used natively by brigadier.
This supports all forms of formatting including entity selectors, scores, click & hover events, translations, keybinds and more.
Note: the bungee component api is deprecated, and the adventure text component api should be used instead
components | array of bungee text components |
|
staticinherited |
Converts an unformatted string to an unformatted tooltip by wrapping as with a LiteralMessage
.
If formatting is required, please see the various other messageFromXXX
methods.
string | unformatted string tooltip |
LiteralMessage
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
static |
Constructs a BukkitTooltip<S>
with a suggestion and a formatted tooltip.
<S> | the object that the argument suggestions use |
object | the suggestion to provide to the user |
tooltip | the formatted tooltip to show to the user when they hover over the suggestion |
BukkitTooltip<S>
representing this suggestion and tooltip
|
static |
Constructs a BukkitTooltip<S>
with a suggestion and a formatted tooltip.
<S> | the object that the argument suggestions use |
object | the suggestion to provide to the user |
tooltip | the formatted tooltip to show to the user when they hover over the suggestion |
BukkitTooltip<S>
representing this suggestion and tooltip
|
staticinherited |
|
staticinherited |