Skip to content

Commit

Permalink
brigadier: properly map number suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Mar 11, 2024
1 parent 2242595 commit 6f5736b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ public BrigadierSuggestionFactory(
final SuggestionsBuilder suggestionsBuilder = builder.createOffset(rawOffset + trimmed);

for (final TooltipSuggestion suggestion : suggestions) {
suggestionsBuilder.suggest(suggestion.suggestion(), suggestion.tooltip());
try {
suggestionsBuilder.suggest(Integer.parseInt(suggestion.suggestion()), suggestion.tooltip());
} catch (final NumberFormatException e) {
suggestionsBuilder.suggest(suggestion.suggestion(), suggestion.tooltip());
}
}

return suggestionsBuilder.build();
Expand Down

0 comments on commit 6f5736b

Please sign in to comment.