From a6293e163d96e02a263d24a562ed61b2431fb884 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 20 Dec 2020 17:30:05 +0100 Subject: [PATCH] Hotfix Tabcomplete and colors --- .../misslewars/commands/CommandInvite.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/misslewars/commands/CommandInvite.java b/src/de/steamwar/misslewars/commands/CommandInvite.java index 1f7414d..0814c3f 100644 --- a/src/de/steamwar/misslewars/commands/CommandInvite.java +++ b/src/de/steamwar/misslewars/commands/CommandInvite.java @@ -74,14 +74,24 @@ public class CommandInvite implements CommandExecutor, TabCompleter { team.invitePlayer(invitedPlayer); 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("§8/§6accept §8- §7Zum akzeptieren."); - invitedPlayer.sendMessage("§8/§6decline §8- §7Zum ablehnen."); + invitedPlayer.sendMessage("§8/§eaccept §8- §7Zum akzeptieren."); + invitedPlayer.sendMessage("§8/§edecline §8- §7Zum ablehnen."); return false; } @Override public List 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() .stream() .filter(p -> MissileWars.getTeam(p) != null)