From 1ac51e54e183bcf4cc5745ce42f18778703e735d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 4 Jan 2021 18:42:48 +0100 Subject: [PATCH] Green color online teammembers Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index f9cb50eb..0d503cec 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -389,6 +389,10 @@ public class TeamCommand extends BasicCommand { BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast den Spieler §e" + args[1] + " §7zum Leader gemacht!"); } + private String playerName(SteamwarUser user){ + return ProxyServer.getInstance().getPlayer(user.getUuid()) != null ? "§a" + user.getUserName() : "§e" + user.getUserName(); + } + private void info(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ if(args.length == 1 && user.getTeam() == 0){ BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam info §8[§eTeamname§8]"); @@ -403,17 +407,16 @@ public class TeamCommand extends BasicCommand { } BungeeCore.send(player, "§7Team §e" + team.getTeamName() + " §8[§" + team.getTeamColor() + team.getTeamKuerzel() + "§8]"); - BungeeCore.send(player, "§7Leader§8: " + SteamwarUser.get(team.getTeamLeader()).getUserName()); + BungeeCore.send(player, "§7Leader§8: " + playerName(SteamwarUser.get(team.getTeamLeader()))); if(team.getMembers().size() > 1) { StringBuilder sb = new StringBuilder(); - sb.append("§7Member§8: §e"); + sb.append("§7Member§8: "); List members = team.getMembers(); for (int i : members) { if (i == team.getTeamLeader()) continue; - SteamwarUser m = SteamwarUser.get(i); - sb.append(m.getUserName()).append(" "); + sb.append(playerName(SteamwarUser.get(i))).append(" "); } BungeeCore.send(player, sb.toString()); }