Skip to content

Commit

Permalink
follow dmk feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
vLuckyyy committed Feb 13, 2025
1 parent dbb8000 commit 5dd21d0
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
@LiteArgument(type = int.class, name = ItemLoreArgument.KEY)
class ItemLoreArgument extends AbstractViewerArgument<Integer> {

private static final List<Integer> suggestions = List.of(1, 2, 3, 4, 5, 6); // Sugeruj numery od 1 do 6
static final String KEY = "item-lore";

// Suggests numbers from 1 to 6, because in the command we add +1
// so that users who are not aware that programming counts from zero understand it.
private static final List<Integer> suggestions = List.of(1, 2, 3, 4, 5, 6);

@Inject
public ItemLoreArgument(TranslationManager translationManager) {
super(translationManager);
Expand All @@ -42,9 +45,12 @@ public ParseResult<Integer> parse(Invocation<CommandSender> invocation, String a
}

@Override
public SuggestionResult suggest(Invocation<CommandSender> invocation, Argument<Integer> argument, SuggestionContext context) {
public SuggestionResult suggest(
Invocation<CommandSender> invocation,
Argument<Integer> argument,
SuggestionContext context) {
return suggestions.stream()
.map(String::valueOf)
.collect(SuggestionResult.collector());
.map(String::valueOf)
.collect(SuggestionResult.collector());
}
}

0 comments on commit 5dd21d0

Please sign in to comment.