geforkt von SteamWar/BungeeCore
Add Team showcase in tablist
Dieser Commit ist enthalten in:
Ursprung
3606e75ab6
Commit
f2a8cb064e
@ -21,7 +21,9 @@ package de.steamwar.bungeecore.tablist;
|
||||
|
||||
import de.steamwar.bungeecore.Servertype;
|
||||
import de.steamwar.bungeecore.Subserver;
|
||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
@ -62,8 +64,15 @@ public class TablistBuild implements TablistPart {
|
||||
tablist.add(new Item(null, viewer.parseToLegacy("TABLIST_BAU"), TablistServer.LIGHT_GRAY));
|
||||
}
|
||||
|
||||
for(ServerInfo info : servers) {
|
||||
(server == info ? direct : tablist).addAll(players.get(info));
|
||||
int team = SteamwarUser.get(player).getTeam();
|
||||
for (ServerInfo info : servers) {
|
||||
players.get(info).stream()
|
||||
.map(item -> {
|
||||
ProxiedPlayer p = BungeeCord.getInstance().getPlayer(item.getUuid());
|
||||
if (p == null) return item;
|
||||
if (SteamwarUser.get(p).getTeam() != team) return item;
|
||||
return new Item(p, true);
|
||||
}).forEach(((server == info) ? direct : tablist)::add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren