SteamWar/BungeeCore
Archiviert
13
2

Add ReverColor for Ranks

Dieser Commit ist enthalten in:
Chaoscaot 2020-08-29 15:25:47 +02:00
Ursprung 41dd504191
Commit 2807bf40e2

Datei anzeigen

@ -139,10 +139,12 @@ public class ChatListener extends BasicListener {
private void publicChat(SteamwarUser user, ProxiedPlayer sender, String message){ private void publicChat(SteamwarUser user, ProxiedPlayer sender, String message){
String name = sender.getDisplayName(); String name = sender.getDisplayName();
String chatsuffix = "§7» "; String chatsuffix = "§7» ";
String revertColor = "§7";
message = message.replace('§', '&'); message = message.replace('§', '&');
if(sender.hasPermission("bungeecore.group.admin")){ if(sender.hasPermission("bungeecore.group.admin")){
chatsuffix = "§7» §e"; chatsuffix = "§7» §e";
revertColor = "§e";
message = ChatColor.translateAlternateColorCodes('&', message); message = ChatColor.translateAlternateColorCodes('&', message);
}else if( }else if(
sender.hasPermission("bungeecore.group.developer") || sender.hasPermission("bungeecore.group.developer") ||
@ -150,6 +152,7 @@ public class ChatListener extends BasicListener {
sender.hasPermission("bungeecore.group.supporter") || sender.hasPermission("bungeecore.group.supporter") ||
sender.hasPermission("bungeecore.group.builder")){ sender.hasPermission("bungeecore.group.builder")){
chatsuffix = "§7» §r"; chatsuffix = "§7» §r";
revertColor = "§r";
message = ChatColor.translateAlternateColorCodes('&', message); message = ChatColor.translateAlternateColorCodes('&', message);
}else if(sender.hasPermission("bungeecore.group.youtuber")){ }else if(sender.hasPermission("bungeecore.group.youtuber")){
message = ChatColor.translateAlternateColorCodes('&', message); message = ChatColor.translateAlternateColorCodes('&', message);
@ -164,7 +167,7 @@ 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.contains("@" + target.getName())) { if(msg.contains("@" + target.getName())) {
BungeeCore.send(target, ChatMessageType.CHAT, msg.replace("@" + target.getName(), "§e@" + target.getName() + "§r")); BungeeCore.send(target, ChatMessageType.CHAT, msg.replace("@" + target.getName(), "§e@" + target.getName() + revertColor));
}else { }else {
BungeeCore.send(target, ChatMessageType.CHAT, msg); BungeeCore.send(target, ChatMessageType.CHAT, msg);
} }