Archiviert
1
0

@Player IgnoreCase

Dieser Commit ist enthalten in:
Chaoscaot 2020-08-29 21:21:21 +02:00
Ursprung e07b7362d5
Commit 6534a56b17

Datei anzeigen

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