use of net.elytrium.limbofilter.LimboFilter in project LimboFilter by Elytrium.
the class LimboFilterCommand method suggest.
@Override
public List<String> suggest(SimpleCommand.Invocation invocation) {
CommandSource source = invocation.source();
String[] args = invocation.arguments();
if (args.length == 0) {
return this.getSubCommands().filter(cmd -> source.hasPermission("limbofilter." + cmd)).collect(Collectors.toList());
} else if (args.length == 1) {
return this.getSubCommands().filter(cmd -> source.hasPermission("limbofilter." + cmd)).filter(str -> str.regionMatches(true, 0, args[0], 0, args[0].length())).collect(Collectors.toList());
}
return ImmutableList.of();
}
Aggregations