Skip to content

Commit fe98ca2

Browse files
committed
#500: Update the documentation for tooltips to reflect the actual API
1 parent ac300b3 commit fe98ca2

File tree

1 file changed

+6
-5
lines changed
  • docs/en/create-commands/arguments/suggestions

1 file changed

+6
-5
lines changed

docs/en/create-commands/arguments/suggestions/tooltips.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ To use these features, the CommandAPI includes the `stringsWithTooltips` methods
2323

2424
```java
2525
ArgumentSuggestions stringsWithTooltips(IStringTooltip... suggestions);
26+
ArgumentSuggestions stringsWithTooltips(Collection<IStringTooltip> suggestions);
2627
ArgumentSuggestions stringsWithTooltips(Function<SuggestionInfo, IStringTooltip[]> suggestions);
2728
```
2829

29-
The `StringTooltip` class is the CommandAPI's default implementation of `IStringTooltip`, which has some static methods to construct tooltips easily:
30+
The `StringTooltip` and `BukkitStringTooltip` classes are the CommandAPI's default implementations of `IStringTooltip`, which have some static methods to construct tooltips easily:
3031

3132
```java
3233
StringTooltip none(String suggestion);
3334
StringTooltip ofString(String suggestion, String tooltip);
3435
StringTooltip ofMessage(String suggestion, Message tooltip);
35-
StringTooltip ofBaseComponents(String suggestion, BaseComponent... tooltip);
36-
StringTooltip ofAdventureComponent(String suggestion, Component tooltip);
36+
BukkitStringTooltip ofBaseComponents(String suggestion, BaseComponent... tooltip);
37+
BukkitStringTooltip ofAdventureComponent(String suggestion, ComponentLike tooltip);
3738
```
3839

3940
The first method, `StringTooltip.none(String)` creates a normal suggestion entry with no tooltip. The other methods create a suggestion with the provided tooltip text in either `String`, Brigadier `Message`, Spigot `BaseComponent[]` or Adventure `Component` format.
@@ -126,8 +127,8 @@ Just like the `StringTooltip` class, the `Tooltip<S>` class provides the followi
126127
Tooltip<S> none(S object);
127128
Tooltip<S> ofString(S object, String tooltip);
128129
Tooltip<S> ofMessage(S object, Message tooltip);
129-
Tooltip<S> ofBaseComponents(S object, BaseComponent... tooltip);
130-
Tooltip<S> ofAdventureComponent(S object, Component tooltip);
130+
BukkitTooltip<S> ofBaseComponents(S object, BaseComponent... tooltip);
131+
BukkitTooltip<S> ofAdventureComponent(S object, ComponentLike tooltip);
131132

132133
Tooltip<S>[] arrayOf(Tooltip<S>... tooltips);
133134
```

0 commit comments

Comments
 (0)