SteamWar/BungeeCore
Archiviert
13
2

Add external players of teamserver to tablist of player #498

Zusammengeführt
Lixfel hat 3 Commits von BetterSWTCITablistIntegration nach master 2023-12-06 16:41:42 +01:00 zusammengeführt
Nur Änderungen aus Commit 56a9bd077c werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -95,8 +95,9 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
update.add(tabItem);
}
}
boolean playerOnTeamserver = !Storage.teamServers.containsValue(player.getServer().getInfo());
for(PlayerListItem.Item item : directTabItems.values()) {
if(!nonNPCs.contains(item.getUuid()) && !npcs.contains(item.getUuid()) && !player.getUniqueId().equals(item.getUuid())) {
if(!playerOnTeamserver && !nonNPCs.contains(item.getUuid()) && !npcs.contains(item.getUuid()) && !player.getUniqueId().equals(item.getUuid())) {
npcs.add(item.getUuid());
addNpc.add(item.getUsername());
}
@ -210,10 +211,13 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
}
break;
case ADD_PLAYER:
boolean playerOnTeamserver = !Storage.teamServers.containsValue(player.getServer().getInfo());
for (PlayerListItem.Item item : list.getItems()) {
item.setPing(1);
item.setDisplayName(new TextComponent());
item.setListed(false);
if (playerOnTeamserver) {
item.setDisplayName(new TextComponent());
item.setListed(false);
}
item.setPublicKey(null);
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
item.setGamemode(1);