SteamWar/BungeeCore
Archiviert
13
2

Fix NPC removal in Tablist
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-12-10 12:38:07 +01:00
Ursprung 0c509bdfdc
Commit 5fd0dcae65

Datei anzeigen

@ -238,11 +238,15 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
break; break;
} }
} else if(packet instanceof PlayerListItemRemove) { } else if(packet instanceof PlayerListItemRemove) {
List<String> names = new ArrayList<>();
for(UUID uuid : ((PlayerListItemRemove) packet).getUuids()) { for(UUID uuid : ((PlayerListItemRemove) packet).getUuids()) {
synchronized (directTabItems) { synchronized (directTabItems) {
directTabItems.remove(uuid); PlayerListItem.Item directItem = directTabItems.remove(uuid);
if(npcs.remove(uuid))
names.add(directItem.getUsername());
} }
} }
sendNpcPacket(names, true);
} else if(packet instanceof PlayerListItemUpdate) { } else if(packet instanceof PlayerListItemUpdate) {
PlayerListItemUpdate list = (PlayerListItemUpdate) packet; PlayerListItemUpdate list = (PlayerListItemUpdate) packet;
EnumSet<PlayerListItemUpdate.Action> actions = list.getActions(); EnumSet<PlayerListItemUpdate.Action> actions = list.getActions();