Package dev.jorel.commandapi
Class BukkitStringTooltip
java.lang.Object
dev.jorel.commandapi.StringTooltip
dev.jorel.commandapi.BukkitStringTooltip
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBukkitStringTooltip(String suggestion, com.mojang.brigadier.Message tooltip) -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<StringTooltip> generateAdventureComponents(Function<String, net.kyori.adventure.text.Component> tooltipGenerator, String... suggestions) Constructs a collection ofStringTooltipobjects from an array of suggestions, and a function which generates a tooltip formatted as an adventureComponentfor each suggestionstatic Collection<StringTooltip> generateAdventureComponents(Function<String, net.kyori.adventure.text.Component> tooltipGenerator, Collection<String> suggestions) Constructs a collection ofStringTooltipobjects from a collection of suggestions, and a function which generates a tooltip formatted as an adventureComponentfor each suggestionstatic Collection<StringTooltip> generateBaseComponents(Function<String, net.md_5.bungee.api.chat.BaseComponent[]> tooltipGenerator, String... suggestions) Constructs a collection ofStringTooltipobjects from an array of suggestions, and a function which generates a formatted tooltip for each suggestionstatic Collection<StringTooltip> generateBaseComponents(Function<String, net.md_5.bungee.api.chat.BaseComponent[]> tooltipGenerator, Collection<String> suggestions) Constructs a collection ofStringTooltipobjects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestionstatic StringTooltipofAdventureComponent(String suggestion, net.kyori.adventure.text.Component tooltip) Constructs a StringTooltip with a suggestion and a formatted adventure text component tooltipstatic StringTooltipofBaseComponents(String suggestion, net.md_5.bungee.api.chat.BaseComponent... tooltip) Constructs a StringTooltip with a suggestion and a formatted bungee text component tooltipMethods inherited from class dev.jorel.commandapi.StringTooltip
generate, generate, generate, generateMessages, generateMessages, generateStrings, generateStrings, getSuggestion, getTooltip, none, none, none, ofMessage, ofString
-
Constructor Details
-
BukkitStringTooltip
-
-
Method Details
-
ofBaseComponents
public static StringTooltip ofBaseComponents(String suggestion, net.md_5.bungee.api.chat.BaseComponent... tooltip) Constructs a StringTooltip with a suggestion and a formatted bungee text component tooltip- Parameters:
suggestion- the suggestion to provide to the usertooltip- the formatted tooltip to show to the user when they hover over the suggestion- Returns:
- a StringTooltip representing this suggestion and tooltip
-
ofAdventureComponent
public static StringTooltip ofAdventureComponent(String suggestion, net.kyori.adventure.text.Component tooltip) Constructs a StringTooltip with a suggestion and a formatted adventure text component tooltip- Parameters:
suggestion- the suggestion to provide to the usertooltip- the formatted tooltip to show to the user when they hover over the suggestion- Returns:
- a StringTooltip representing this suggestion and tooltip
-
generateBaseComponents
public static Collection<StringTooltip> generateBaseComponents(Function<String, net.md_5.bungee.api.chat.BaseComponent[]> tooltipGenerator, String... suggestions) Constructs a collection ofStringTooltipobjects from an array of suggestions, and a function which generates a formatted tooltip for each suggestion- Parameters:
tooltipGenerator- function which returns a formatted tooltip for the suggestion, an array ofBaseComponentssuggestions- array of suggestions to provide to the user- Returns:
- a collection of
StringTooltipobjects from the provided suggestions, with the generated formatted tooltips
-
generateBaseComponents
public static Collection<StringTooltip> generateBaseComponents(Function<String, net.md_5.bungee.api.chat.BaseComponent[]> tooltipGenerator, Collection<String> suggestions) Constructs a collection ofStringTooltipobjects from a collection of suggestions, and a function which generates a formatted tooltip for each suggestion- Parameters:
tooltipGenerator- function which returns a formatted tooltip for the suggestion, an array ofBaseComponentssuggestions- collection of suggestions to provide to the user- Returns:
- a collection of
StringTooltipobjects from the provided suggestions, with the generated formatted tooltips
-
generateAdventureComponents
public static Collection<StringTooltip> generateAdventureComponents(Function<String, net.kyori.adventure.text.Component> tooltipGenerator, String... suggestions) Constructs a collection ofStringTooltipobjects from an array of suggestions, and a function which generates a tooltip formatted as an adventureComponentfor each suggestion- Parameters:
tooltipGenerator- function which returns a formatted tooltip for the suggestion, an adventureComponentsuggestions- array of suggestions to provide to the user- Returns:
- a collection of
StringTooltipobjects from the provided suggestions, with the generated formatted tooltips
-
generateAdventureComponents
public static Collection<StringTooltip> generateAdventureComponents(Function<String, net.kyori.adventure.text.Component> tooltipGenerator, Collection<String> suggestions) Constructs a collection ofStringTooltipobjects from a collection of suggestions, and a function which generates a tooltip formatted as an adventureComponentfor each suggestion- Parameters:
tooltipGenerator- function which returns a formatted tooltip for the suggestion, an adventureComponentsuggestions- collection of suggestions to provide to the user- Returns:
- a collection of
StringTooltipobjects from the provided suggestions, with the generated formatted tooltips
-