Merge branch 'chatRework' into 'master'
Changed Chat See merge request Yaruma3341/fightsystem!4
Dieser Commit ist enthalten in:
Commit
a6019bdbdb
@ -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(fightTeam != null){
|
||||||
|
String prefixColorCode = fightTeam.getPrefix();
|
||||||
|
String teamName = fightTeam.getName();
|
||||||
if(message.startsWith(teamChatDetection)){
|
if(message.startsWith(teamChatDetection)){
|
||||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
fightTeam.broadcast(prefixColorCode + player.getName() + "» " + prefixColorCode + message);
|
||||||
if(fightTeam != null) fightTeam.broadcast("§5" + player.getName() + "§e--> §2" + message);
|
|
||||||
} else {
|
} else {
|
||||||
FightTeam fightTeam = Fight.getPlayerTeam(player);
|
Bukkit.broadcastMessage(prefixColorCode + teamName + " " + player.getName() + " §8» " + message);
|
||||||
if(fightTeam == Fight.redTeam) {
|
|
||||||
String prefixColorCode = fileManager.getStringFromConfig("Output.TeamRedColor");
|
|
||||||
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren