diff --git a/src/de/steamwar/bungeecore/tablist/Tablist.java b/src/de/steamwar/bungeecore/tablist/Tablist.java index 958952c..be8d920 100644 --- a/src/de/steamwar/bungeecore/tablist/Tablist.java +++ b/src/de/steamwar/bungeecore/tablist/Tablist.java @@ -148,8 +148,8 @@ public class Tablist extends MessageToMessageDecoder { synchronized (directTabItems) { directTabItems.clear(); sendNpcPacket(npcs.stream().map(npc -> directTabItems.get(npc).getUsername()).collect(Collectors.toList()), true); + npcs.clear(); } - npcs.clear(); if(connection != null) { connection.getCh().getHandle().pipeline().addBefore(PipelineUtils.BOSS_HANDLER, "steamwar-tablist", this); @@ -162,8 +162,8 @@ public class Tablist extends MessageToMessageDecoder { current.clear(); synchronized (directTabItems) { sendNpcPacket(npcs.stream().map(npc -> directTabItems.get(npc).getUsername()).collect(Collectors.toList()), true); + npcs.clear(); } - npcs.clear(); if(connection != null) connection.getCh().getHandle().pipeline().remove(this); @@ -209,12 +209,15 @@ public class Tablist extends MessageToMessageDecoder { } break; case REMOVE_PLAYER: + List names = new ArrayList<>(); for(PlayerListItem.Item item : list.getItems()) { synchronized (directTabItems) { - directTabItems.remove(item.getUuid()); + PlayerListItem.Item directItem = directTabItems.remove(item.getUuid()); + if(npcs.remove(item.getUuid())) + names.add(directItem.getUsername()); } - npcs.remove(item.getUuid()); } + sendNpcPacket(names, true); break; } }