From adc6feafd8af02ba37f89bff5894e391a999e137 Mon Sep 17 00:00:00 2001 From: Florian Stober Date: Sun, 5 Nov 2023 19:17:11 +0100 Subject: [PATCH] clear custom slots on server switch, should have the same effect as reloading the plugin; see #731 --- .../bungeetablistplus/handler/NewTabOverlayHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java index ffeef845..859b8ea7 100644 --- a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java +++ b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java @@ -651,7 +651,9 @@ private String getCustomSlotUsername(int index) { @Override void onServerSwitch() { - // do nothing + if (player.getPendingConnection().getVersion() >= 764) { + clearCustomSlots(); + } } @Override @@ -688,6 +690,10 @@ private void createTeamsIfNecessary() { @Override void onDeactivated() { + clearCustomSlots(); + } + + private void clearCustomSlots() { int customSlots = 0; for (int index = 0; index < 80; index++) { if (slotState[index] != SlotState.UNUSED) {