Skip to content

Commit

Permalink
1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisKarolGajda committed Aug 18, 2022
1 parent bae30a4 commit 419b93a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/me/opkarol/opc/api/commands/OpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public List<String> tabCompleteFunction(@NotNull CommandSender sender, @NotNull
if (simpleSuggestions.size() != 0) {
completions.addAll(simpleSuggestions.get(args.length - 1).getSuggestions());
} else if (suggestions.size() != 0) {
completions.add(suggestions.get(args.length - 1).apply(new OpCommandSender(sender), args));
completions.addAll(suggestions.get(args.length - 1).apply(new OpCommandSender(sender), args));
}

if (completions.size() == 0) {
Expand All @@ -173,7 +173,7 @@ public List<String> tabCompleteFunction(@NotNull CommandSender sender, @NotNull
completions.addAll(simpleSuggestions.get(args.length - 2).getSuggestions());
}
if (suggestions.size() + 1 >= args.length) {
completions.add(suggestions.get(args.length - 2).apply(new OpCommandSender(sender), args));
completions.addAll(suggestions.get(args.length - 2).apply(new OpCommandSender(sender), args));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import me.opkarol.opc.api.commands.OpCommandSender;

import java.util.List;
import java.util.function.BiFunction;

public record OpCommandSuggestion(
BiFunction<OpCommandSender, String[], String> biFunction) {
BiFunction<OpCommandSender, String[], List<String>> biFunction) {

public String apply(OpCommandSender commandSender, String[] args) {
public List<String> apply(OpCommandSender commandSender, String[] args) {
return biFunction.apply(commandSender, args);
}
}

0 comments on commit 419b93a

Please sign in to comment.