From e07b7362d5c43945cd2918077c2a2a8b7ab0722f Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 29 Aug 2020 18:23:31 +0200 Subject: [PATCH] @Player Autocomplete --- src/de/steamwar/bungeecore/listeners/ChatListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index cb255d67..a387104b 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -163,7 +163,7 @@ public class ChatListener extends BasicListener { for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ Subserver targetServer = Subserver.getSubserver(target); if(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo()){ - if(msg.contains("@" + target.getName())) { + if(msg.toLowerCase().contains("@" + target.getName().toLowerCase())) { BungeeCore.send(target, ChatMessageType.CHAT, msg.replace("@" + target.getName(), "§e@" + target.getName() + chatcolor)); }else { BungeeCore.send(target, ChatMessageType.CHAT, msg); @@ -208,7 +208,7 @@ public class ChatListener extends BasicListener { else last = ""; for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){ - String name = player.getName(); + String name = player.getName().replace("@", ""); if(last.isEmpty() || name.startsWith(last)){ suggestions.add(name); } @@ -221,6 +221,7 @@ public class ChatListener extends BasicListener { } } } + } @EventHandler