SteamWar/MissileWars
Archiviert
13
0

Fix CommandInvite TabCompleter

Dieser Commit ist enthalten in:
jojo 2020-12-22 14:55:23 +01:00
Ursprung a6293e163d
Commit 14b68fa45a

Datei anzeigen

@ -81,7 +81,7 @@ public class CommandInvite implements CommandExecutor, TabCompleter {
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 0) {
if (args.length == 1) {
return Bukkit.getOnlinePlayers()
.stream()
.filter(p -> MissileWars.getTeam(p) != null)
@ -89,16 +89,7 @@ public class CommandInvite implements CommandExecutor, TabCompleter {
.map(Player::getName)
.collect(Collectors.toList());
}
if (args.length != 1) {
return new ArrayList<>();
}
return Bukkit.getOnlinePlayers()
.stream()
.filter(p -> MissileWars.getTeam(p) != null)
.filter(p -> MissileWars.getInvitation(p) != null)
.map(Player::getName)
.filter(s -> s.startsWith(args[0]))
.collect(Collectors.toList());
return new ArrayList<>();
}
}