SteamWar/BungeeCore
Archiviert
13
2

Fix TablistManager add Team visibility

Dieser Commit ist enthalten in:
yoyosource 2021-06-25 10:47:17 +02:00
Ursprung 09214a0212
Commit d11b4ba9ca

Datei anzeigen

@ -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<ProxiedPlayer> 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){