From edbaddbee6d7e768a3924d36301fffb81cccd8b5 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 25 Jun 2021 15:31:29 +0200 Subject: [PATCH] Update TablistManager --- .../bungeecore/listeners/TablistManager.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index fbfb3300..de2c98f1 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -176,7 +176,7 @@ public class TablistManager extends BasicListener { i++; for (ProxiedPlayer p : playerMap.get(server)){ boolean sameServer = currentServer == p.getServer().getInfo(); - setSlot(i % 20, i / 20, BungeeTabListPlusAPI.getIconFromPlayer(p), getTablistName(p, sameServer), (sameServer ? 1 : 500)); + setSlot(i % 20, i / 20, BungeeTabListPlusAPI.getIconFromPlayer(p), getTablistName(p), (sameServer ? 1 : 500)); i++; } } @@ -225,7 +225,7 @@ public class TablistManager extends BasicListener { i++; for (ProxiedPlayer p : players){ boolean sameServer = currentServer == p.getServer().getInfo(); - setSlot(i % 20, i / 20, BungeeTabListPlusAPI.getIconFromPlayer(p), getTablistName(p, sameServer), (sameServer ? 1 : 500)); + setSlot(i % 20, i / 20, BungeeTabListPlusAPI.getIconFromPlayer(p), getTablistName(p), (sameServer ? 1 : 500)); i++; } } @@ -245,7 +245,7 @@ public class TablistManager extends BasicListener { return team.getTeamId() <= 0 ? null : team; } - private String getTablistName(ProxiedPlayer p, boolean sameServer) { + private String getTablistName(ProxiedPlayer p) { Subserver server = Subserver.getSubserver(p); if(server != null){ String tablistName = server.getTablistNames().get(p); @@ -256,13 +256,14 @@ public class TablistManager extends BasicListener { StringBuilder st = new StringBuilder(); UserGroup group = SteamwarUser.get(p).getUserGroup(); - //else st.append("§7"); - if(group == UserGroup.Member && sameServer) - st.append("§f"); - else + if (group == UserGroup.Member) { + Team team = getTeam(player); + if (team != null && team == getTeam(p)) st.append("§f"); + else st.append("§7"); + } else { st.append(group.getColorCode()); + } - // if (!sameServer) st.append("§o"); return st.append(p.getName()).toString(); } }