From 2807bf40e2b8100364350b6837379615f2370bce Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 15:25:47 +0200 Subject: [PATCH] Add ReverColor for Ranks --- src/de/steamwar/bungeecore/listeners/ChatListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index dc2111b..fe6d92b 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -139,10 +139,12 @@ public class ChatListener extends BasicListener { private void publicChat(SteamwarUser user, ProxiedPlayer sender, String message){ String name = sender.getDisplayName(); String chatsuffix = "§7» "; + String revertColor = "§7"; message = message.replace('§', '&'); if(sender.hasPermission("bungeecore.group.admin")){ chatsuffix = "§7» §e"; + revertColor = "§e"; message = ChatColor.translateAlternateColorCodes('&', message); }else if( sender.hasPermission("bungeecore.group.developer") || @@ -150,6 +152,7 @@ public class ChatListener extends BasicListener { sender.hasPermission("bungeecore.group.supporter") || sender.hasPermission("bungeecore.group.builder")){ chatsuffix = "§7» §r"; + revertColor = "§r"; message = ChatColor.translateAlternateColorCodes('&', message); }else if(sender.hasPermission("bungeecore.group.youtuber")){ message = ChatColor.translateAlternateColorCodes('&', message); @@ -164,7 +167,7 @@ public class ChatListener extends BasicListener { Subserver targetServer = Subserver.getSubserver(target); if(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo()){ 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 { BungeeCore.send(target, ChatMessageType.CHAT, msg); }