From d11b4ba9ca56b7edc71c8238980aefd3a1cbd58a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 25 Jun 2021 10:47:17 +0200 Subject: [PATCH] Fix TablistManager add Team visibility --- src/de/steamwar/bungeecore/listeners/TablistManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index 6a1d965..d5da6f2 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -27,6 +27,7 @@ import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.sql.SteamwarUser; +import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.UserGroup; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; @@ -200,9 +201,10 @@ public class TablistManager extends BasicListener { i++; } spacer = true; + Team team = getTeam(player); List players = playerMap.get(server) .stream() - .filter(p -> p.getServer().getInfo() == currentServer || SteamwarUser.get(p).getUserGroup() != UserGroup.Member) + .filter(p -> p.getServer().getInfo() == currentServer || SteamwarUser.get(p).getUserGroup() != UserGroup.Member || team == getTeam(p)) .collect(Collectors.toList()); if (server.equals("Bau")) { Subserver subserver = Subserver.getSubserver(player); @@ -238,6 +240,10 @@ public class TablistManager extends BasicListener { } } + private Team getTeam(ProxiedPlayer p) { + return Team.get(SteamwarUser.get(p).getTeam()); + } + private String getTablistName(ProxiedPlayer p, boolean sameServer) { Subserver server = Subserver.getSubserver(p); if(server != null){