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 6534a56b17 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -155,7 +155,7 @@ public class ChatListener extends BasicListener {
message = ChatColor.translateAlternateColorCodes('&', message);
}
String msg = name + "§7» " + chatcolor + message;
String msg = name + "§7»" + chatcolor + " " + message;
if(user.getTeam() != 0){
msg = "§8" + Team.get(user.getTeam()).getTeamKuerzel() + " §r" + msg;
}
@ -164,7 +164,15 @@ public class ChatListener extends BasicListener {
Subserver targetServer = Subserver.getSubserver(target);
if(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo()){
if(msg.toLowerCase().contains("@" + target.getName().toLowerCase())) {
BungeeCore.send(target, ChatMessageType.CHAT, msg.replace("@" + target.getName(), "§e@" + target.getName() + chatcolor));
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);
}else {
BungeeCore.send(target, ChatMessageType.CHAT, msg);
}
@ -208,8 +216,8 @@ public class ChatListener extends BasicListener {
else
last = "";
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
String name = player.getName().replace("@", "");
if(last.isEmpty() || name.startsWith(last)){
String name = player.getName();
if (last.isEmpty() || name.startsWith(last)) {
suggestions.add(name);
}
}