From 5637311be5b0e1824c31919f7b12c9b704a1864a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 28 Jun 2021 17:06:00 +0200 Subject: [PATCH 1/2] Hotfix Tablist --- .../bungeecore/listeners/TablistManager.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index fd386a9..fd31ce2 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -69,15 +69,11 @@ public class TablistManager extends BasicListener { } } - private void calculateSize(){ + private void calculateSize() { size = -1; - for(Map.Entry> server : playerMap.entrySet()) - size += 2 + server.getValue().size(); - - size = (size+19)/20; - - if(size > 5) - size = 5; + size += playerMap.size() * 2 + ProxyServer.getInstance().getPlayers().size(); + size = (size + 19) / 20 + 1; + if(size > 5) size = 5; } private synchronized void updateCustomTablist(){ @@ -224,8 +220,6 @@ public class TablistManager extends BasicListener { i = update(currentServer, players, i); } - // Shrink Down - setSize(Math.min((i + 19) / 20, 4), 20); finish(i); }catch(IndexOutOfBoundsException | NullPointerException e){ //Ignore IndexOutOfBoundsException From 64c8af3064c5c568567e34ca583eb86b6b54bf4c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 28 Jun 2021 17:27:29 +0200 Subject: [PATCH 2/2] Fix TablistManager --- src/de/steamwar/bungeecore/listeners/TablistManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index fd31ce2..d69a1e8 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -72,7 +72,7 @@ public class TablistManager extends BasicListener { private void calculateSize() { size = -1; size += playerMap.size() * 2 + ProxyServer.getInstance().getPlayers().size(); - size = (size + 19) / 20 + 1; + size = (size + 19) / 20; if(size > 5) size = 5; }