Merge pull request 'Add external players of teamserver to tablist of player' (#498) from BetterSWTCITablistIntegration into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #498 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
7411d9d875
@ -95,8 +95,9 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
|||||||
update.add(tabItem);
|
update.add(tabItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
boolean playerNotOnTeamserver = !Storage.teamServers.containsValue(player.getServer().getInfo());
|
||||||
for(PlayerListItem.Item item : directTabItems.values()) {
|
for(PlayerListItem.Item item : directTabItems.values()) {
|
||||||
if(!nonNPCs.contains(item.getUuid()) && !npcs.contains(item.getUuid()) && !player.getUniqueId().equals(item.getUuid())) {
|
if(playerNotOnTeamserver && !nonNPCs.contains(item.getUuid()) && !npcs.contains(item.getUuid()) && !player.getUniqueId().equals(item.getUuid())) {
|
||||||
npcs.add(item.getUuid());
|
npcs.add(item.getUuid());
|
||||||
addNpc.add(item.getUsername());
|
addNpc.add(item.getUsername());
|
||||||
}
|
}
|
||||||
@ -210,10 +211,13 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ADD_PLAYER:
|
case ADD_PLAYER:
|
||||||
|
boolean playerNotOnTeamserver = !Storage.teamServers.containsValue(player.getServer().getInfo());
|
||||||
for (PlayerListItem.Item item : list.getItems()) {
|
for (PlayerListItem.Item item : list.getItems()) {
|
||||||
item.setPing(1);
|
item.setPing(1);
|
||||||
item.setDisplayName(new TextComponent());
|
if (playerNotOnTeamserver) {
|
||||||
item.setListed(false);
|
item.setDisplayName(new TextComponent());
|
||||||
|
item.setListed(false);
|
||||||
|
}
|
||||||
item.setPublicKey(null);
|
item.setPublicKey(null);
|
||||||
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
||||||
item.setGamemode(1);
|
item.setGamemode(1);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren