SteamWar/MissileWars
Archiviert
13
0

Merge pull request 'Add Messages' (#24) from InviteMessages into master

Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
YoyoNow 2020-12-20 14:21:08 +01:00
Commit c6f4ab4777
3 geänderte Dateien mit 13 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -24,6 +24,7 @@ package de.steamwar.misslewars.commands;
import de.steamwar.misslewars.Config; import de.steamwar.misslewars.Config;
import de.steamwar.misslewars.MWTeam; import de.steamwar.misslewars.MWTeam;
import de.steamwar.misslewars.MissileWars; import de.steamwar.misslewars.MissileWars;
import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -48,10 +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 dem Team §abeigetreten§7.");
} else { } else {
MWTeam.removeInvitations(player); MWTeam.removeInvitations(player);
message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 hat die Einladung §cabgelehnt§7.");
} }
return false; return false;
} }
private void message(MWTeam mwTeam, String s) {
mwTeam.getPlayers().forEach(player -> player.sendMessage(s));
}
} }

Datei anzeigen

@ -72,7 +72,8 @@ public class CommandInvite implements CommandExecutor, TabCompleter {
} }
team.invitePlayer(invitedPlayer); team.invitePlayer(invitedPlayer);
invitedPlayer.sendMessage("§7Du wurdest von §6" + player.getName() + "§7 in das Team §6" + MissileWars.getTeam(player).getColoredName() + "§7 eingeladen."); 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/§6accept §8- §7Zum akzeptieren.");
invitedPlayer.sendMessage("§8/§6decline §8- §7Zum ablehnen."); invitedPlayer.sendMessage("§8/§6decline §8- §7Zum ablehnen.");
return false; return false;