Add Messages #24
@ -167,6 +167,10 @@ public class MWTeam {
|
|||||||
return color.toString() + teamName;
|
return color.toString() + teamName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LinkedList<Player> getPlayers() {
|
||||||
|
return players;
|
||||||
|
}
|
||||||
|
|
||||||
public static void removeInvitations(Player p) {
|
public static void removeInvitations(Player p) {
|
||||||
MissileWars.getRedTeam().openInvitations.remove(p);
|
MissileWars.getRedTeam().openInvitations.remove(p);
|
||||||
MissileWars.getBlueTeam().openInvitations.remove(p);
|
MissileWars.getBlueTeam().openInvitations.remove(p);
|
||||||
|
@ -49,20 +49,16 @@ public class CommandAcceptDecline implements CommandExecutor {
|
|||||||
|
|
||||||
if (command.getName().equalsIgnoreCase("accept")) {
|
if (command.getName().equalsIgnoreCase("accept")) {
|
||||||
teamInvitation.acceptInvite(player);
|
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 {
|
} else {
|
||||||
MWTeam.removeInvitations(player);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void message(MWTeam mwTeam, String s) {
|
private void message(MWTeam mwTeam, String s) {
|
||||||
if (mwTeam == MissileWars.getRedTeam()) {
|
mwTeam.getPlayers().forEach(player -> player.sendMessage(s));
|
||||||
Bukkit.getPlayer(Config.RedLeader).sendMessage(s);
|
|
||||||
} else {
|
|
||||||
Bukkit.getPlayer(Config.BlueLeader).sendMessage(s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Wenn der Spieler das Team beitritt sollte diese Nachricht ans ganze Team gehen.