diff --git a/src/de/steamwar/misslewars/MWTeam.java b/src/de/steamwar/misslewars/MWTeam.java index 310dac4..760a393 100644 --- a/src/de/steamwar/misslewars/MWTeam.java +++ b/src/de/steamwar/misslewars/MWTeam.java @@ -167,6 +167,10 @@ public class MWTeam { return color.toString() + teamName; } + public LinkedList getPlayers() { + return players; + } + public static void removeInvitations(Player p) { MissileWars.getRedTeam().openInvitations.remove(p); MissileWars.getBlueTeam().openInvitations.remove(p); diff --git a/src/de/steamwar/misslewars/commands/CommandAcceptDecline.java b/src/de/steamwar/misslewars/commands/CommandAcceptDecline.java index 0744699..2245310 100644 --- a/src/de/steamwar/misslewars/commands/CommandAcceptDecline.java +++ b/src/de/steamwar/misslewars/commands/CommandAcceptDecline.java @@ -49,20 +49,16 @@ public class CommandAcceptDecline implements CommandExecutor { if (command.getName().equalsIgnoreCase("accept")) { teamInvitation.acceptInvite(player); - message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 ist deinem Team §abeigetreten§7."); + message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 ist dem Team §abeigetreten§7."); } else { MWTeam.removeInvitations(player); - message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 hat deine Einladung §cabgelehnt§7."); + message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 hat die Einladung §cabgelehnt§7."); } return false; } private void message(MWTeam mwTeam, String s) { - if (mwTeam == MissileWars.getRedTeam()) { - Bukkit.getPlayer(Config.RedLeader).sendMessage(s); - } else { - Bukkit.getPlayer(Config.BlueLeader).sendMessage(s); - } + mwTeam.getPlayers().forEach(player -> player.sendMessage(s)); } }