SteamWar/FightSystem
Archiviert
13
1
Dieser Commit ist enthalten in:
lixfel 2019-02-23 13:31:26 +01:00
Ursprung 2bc12730ea
Commit ff9491e4ef

Datei anzeigen

@ -21,25 +21,21 @@ public class PlayerChatListener implements Listener {
String teamChatDetection = fileManager.getStringFromConfig("Output.TeamChatDetection"); String teamChatDetection = fileManager.getStringFromConfig("Output.TeamChatDetection");
event.setCancelled(true); FightTeam fightTeam = Fight.getPlayerTeam(player);
if(message.startsWith(teamChatDetection)) { if(fightTeam != null){
FightTeam fightTeam = Fight.getPlayerTeam(player); String prefixColorCode = fightTeam.getPrefix();
if(fightTeam != null) fightTeam.broadcast("§5" + player.getName() + "§e--> §2" + message); String teamName = fightTeam.getName();
} else { if(message.startsWith(teamChatDetection)){
FightTeam fightTeam = Fight.getPlayerTeam(player); fightTeam.broadcast(prefixColorCode + player.getName() + "» " + prefixColorCode + message);
if(fightTeam == Fight.redTeam) { } else {
String prefixColorCode = fileManager.getStringFromConfig("Output.TeamRedColor"); Bukkit.broadcastMessage(prefixColorCode + teamName + " " + player.getName() + " §8» " + message);
String teamName = fileManager.getStringFromConfig("Output.TeamRedName");
Bukkit.broadcastMessage(prefixColorCode + teamName + " " + player.getName() + " §8>> " + prefixColorCode + message);
}
if(fightTeam == Fight.blueTeam) {
String prefixColorCode = fileManager.getStringFromConfig("Output.TeamBlueColor");
String teamName = fileManager.getStringFromConfig("Output.TeamBlueName");
Bukkit.broadcastMessage(prefixColorCode + teamName + " " + player.getName() + " §8>> " + prefixColorCode + message);
} }
}else{
Bukkit.broadcastMessage(player.getName() + " §8» " + message);
} }
event.setCancelled(true);
} }
} }