From 890c3777ce843f3d1a489d69926cd831fbff2f9c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 14:11:07 +0200 Subject: [PATCH] Added @Player to Highlight the Message --- src/de/steamwar/bungeecore/listeners/ChatListener.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index a21dbce9..e4ce0ff6 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -19,6 +19,7 @@ import net.md_5.bungee.api.event.TabCompleteResponseEvent; import net.md_5.bungee.api.scheduler.TaskScheduler; import net.md_5.bungee.event.EventHandler; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -159,10 +160,15 @@ public class ChatListener extends BasicListener { if(user.getTeam() != 0){ msg = "§8" + Team.get(user.getTeam()).getTeamKuerzel() + " §r" + msg; } + for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ Subserver targetServer = Subserver.getSubserver(target); if(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo()){ - BungeeCore.send(target, ChatMessageType.CHAT, msg); + if(msg.contains("@" + target.getName())) { + BungeeCore.send(target, ChatMessageType.CHAT, msg.replace("@" + target.getName(), "§e@" + target.getName() + "§r")); + }else { + BungeeCore.send(target, ChatMessageType.CHAT, msg); + } } } BungeeCore.log(sender.getServer().getInfo(), msg);