Archiviert
1
0

Merge pull request 'Hotfix Tablist' (#226) from HotFixTablist into master

Reviewed-on: SteamWar/BungeeCore#226
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2021-07-01 09:32:47 +02:00
Commit c980a1c92a

Datei anzeigen

@ -69,15 +69,11 @@ public class TablistManager extends BasicListener {
} }
} }
private void calculateSize(){ private void calculateSize() {
size = -1; size = -1;
for(Map.Entry<String, List<ProxiedPlayer>> server : playerMap.entrySet()) size += playerMap.size() * 2 + ProxyServer.getInstance().getPlayers().size();
size += 2 + server.getValue().size(); size = (size + 19) / 20;
if(size > 5) size = 5;
size = (size+19)/20;
if(size > 5)
size = 5;
} }
private synchronized void updateCustomTablist(){ private synchronized void updateCustomTablist(){
@ -224,8 +220,6 @@ public class TablistManager extends BasicListener {
i = update(currentServer, players, i); i = update(currentServer, players, i);
} }
// Shrink Down
setSize(Math.min((i + 19) / 20, 4), 20);
finish(i); finish(i);
}catch(IndexOutOfBoundsException | NullPointerException e){ }catch(IndexOutOfBoundsException | NullPointerException e){
//Ignore IndexOutOfBoundsException //Ignore IndexOutOfBoundsException