Added TabComplete reducer for better suggestions

This commit is contained in:
Elias Müller 2023-10-25 15:26:20 +02:00
parent 09e0db05d9
commit b28a618431

View File

@ -50,6 +50,10 @@ public abstract class ApplianceCommand<T extends Appliance> implements Appliance
return null;
}
protected List<String> tabCompleteReducer(List<String> response, String[] args) {
return response.stream().filter(s -> s.startsWith(args[args.length-1])).toList();
}
protected abstract void execute(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args);
@Override