SteamWar/BungeeCore
Archiviert
13
2

Added @Player to Highlight the Message

Dieser Commit ist enthalten in:
Chaoscaot 2020-08-29 14:11:07 +02:00
Ursprung 0b160cd579
Commit 890c3777ce

Datei anzeigen

@ -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.api.scheduler.TaskScheduler;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -159,10 +160,15 @@ public class ChatListener extends BasicListener {
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;
} }
for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
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()){
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); BungeeCore.log(sender.getServer().getInfo(), msg);