SteamWar/BungeeCore
Archiviert
13
2

@Player Highlighting Ignore Case #103

Manuell gemergt
YoyoNow hat 5 Commits von at-player nach master 2020-08-30 13:22:23 +02:00 zusammengeführt
Nur Änderungen aus Commit 092417ac91 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -160,23 +160,21 @@ public class ChatListener extends BasicListener {
msg = "§8" + Team.get(user.getTeam()).getTeamKuerzel() + " §r" + msg;
}
String[] msgSplits = msg.split(" ");
StringBuilder builder = new StringBuilder();
for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
Subserver targetServer = Subserver.getSubserver(target);
if(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo()){
if(msg.toLowerCase().contains("@" + target.getName().toLowerCase())) {
String toSend = "";
for (String curr : msg.split(" ")) {
if(curr.equalsIgnoreCase("@" + target.getName())) {
toSend += "§e@" + target.getName() + chatcolor + " ";
}else {
toSend += curr + " ";
}
}
BungeeCore.send(target, ChatMessageType.CHAT, toSend);
if(!(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo())) continue;
for (String curr : msgSplits) {
if(curr.equalsIgnoreCase("@" + target.getName())) {
builder.append("§e@").append(target.getName()).append(chatcolor).append(" ");
}else {
BungeeCore.send(target, ChatMessageType.CHAT, msg);
builder.append(curr).append(" ");
}
}
BungeeCore.send(target, ChatMessageType.CHAT, builder.toString());
builder = new StringBuilder();
}
BungeeCore.log(sender.getServer().getInfo(), msg);
}