SteamWar/MissileWars
Archiviert
13
0

Hotfix Tabcomplete and colors

Dieser Commit ist enthalten in:
jojo 2020-12-20 17:30:05 +01:00
Ursprung c6f4ab4777
Commit a6293e163d

Datei anzeigen

@ -74,14 +74,24 @@ public class CommandInvite implements CommandExecutor, TabCompleter {
team.invitePlayer(invitedPlayer); team.invitePlayer(invitedPlayer);
player.sendMessage("§7Du hast §e" + invitedPlayer.getName() + " §7eingeladen."); player.sendMessage("§7Du hast §e" + invitedPlayer.getName() + " §7eingeladen.");
invitedPlayer.sendMessage("§7Du wurdest von §e" + player.getName() + "§7 in das Team §e" + MissileWars.getTeam(player).getColoredName() + "§7 eingeladen."); invitedPlayer.sendMessage("§7Du wurdest von §e" + player.getName() + "§7 in das Team §e" + MissileWars.getTeam(player).getColoredName() + "§7 eingeladen.");
invitedPlayer.sendMessage("§8/§6accept §8- §7Zum akzeptieren."); invitedPlayer.sendMessage("§8/§eaccept §8- §7Zum akzeptieren.");
invitedPlayer.sendMessage("§8/§6decline §8- §7Zum ablehnen."); invitedPlayer.sendMessage("§8/§edecline §8- §7Zum ablehnen.");
return false; return false;
} }
@Override @Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) { public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (args.length != 1) return new ArrayList<>(); if (args.length == 0) {
return Bukkit.getOnlinePlayers()
.stream()
.filter(p -> MissileWars.getTeam(p) != null)
.filter(p -> MissileWars.getInvitation(p) != null)
.map(Player::getName)
.collect(Collectors.toList());
}
if (args.length != 1) {
return new ArrayList<>();
}
return Bukkit.getOnlinePlayers() return Bukkit.getOnlinePlayers()
.stream() .stream()
.filter(p -> MissileWars.getTeam(p) != null) .filter(p -> MissileWars.getTeam(p) != null)