fixed player name tab completing with capitalized names

This commit is contained in:
Teriuihi 2022-01-06 23:47:51 +01:00
parent 73c7a90491
commit 683dda7031

View File

@ -76,11 +76,11 @@ public class CommandManager implements CommandExecutor, TabExecutor {
.filter(subCommand -> commandSender.hasPermission(subCommand.getPermission()))
.map(SubCommand::getName)
.filter(Objects::nonNull)
.filter(name -> args.length == 0 || name.startsWith(args[0]))
.filter(name -> args.length == 0 || name.startsWith(args[0].toLowerCase()))
.collect(Collectors.toList()));
res.addAll(Bukkit.getOnlinePlayers().stream()
.map(Player::getName)
.filter(name -> args.length == 0 || name.startsWith(args[0]))
.filter(name -> args.length == 0 || name.startsWith(args[0].toLowerCase()))
.collect(Collectors.toList()));
} else {
SubCommand subCommand = getSubCommand(args[0]);