diff --git a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java index 50fea221..ffeef845 100644 --- a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java +++ b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java @@ -205,6 +205,12 @@ public PacketListenerResult onPlayerListPacket(PlayerListItem packet) { @Override public PacketListenerResult onPlayerListUpdatePacket(PlayerListItemUpdate packet) { + + if (!active) { + active = true; + scheduleUpdate(); + } + if (packet.getActions().contains(PlayerListItemUpdate.Action.ADD_PLAYER)) { for (PlayerListItem.Item item : packet.getItems()) { if (OPTION_ENABLE_CUSTOM_SLOT_UUID_COLLISION_CHECK) { @@ -298,6 +304,8 @@ public void onServerSwitch(boolean is13OrLater) { if (serverFooter != null) { serverFooter = EMPTY_JSON_TEXT; } + + active = false; } @Override @@ -345,7 +353,7 @@ private void update() { updateScheduledFlag.set(false); ChannelWrapper ch = ((UserConnection) player).getCh(); - if (ch.isClosed() || ch.getEncodeProtocol() != Protocol.GAME) { + if (!active || ch.isClosed() || ch.getEncodeProtocol() != Protocol.GAME) { return; }