SteamWar/BungeeCore
Archiviert
13
2

Hotfix Tablist NPE

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-05-03 15:48:08 +02:00
Ursprung 839d534f55
Commit 889484d1fd

Datei anzeigen

@ -146,12 +146,13 @@ public class TablistManager extends BasicListener {
}
private void refresh(){
try {
ServerInfo currentServer = player.getServer().getInfo();
setHeader(header);
setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms");
setSize(size, 20);
try {
int i = 0;
for (String server : playerMap.navigableKeySet()) {
if (i > 0){
@ -173,8 +174,9 @@ public class TablistManager extends BasicListener {
setSlot(i%20, i/20, darkGray, "", 1000);
i++;
}
}catch(IndexOutOfBoundsException e){
//Ignore
}catch(IndexOutOfBoundsException | NullPointerException e){
//Ignore IndexOutOfBoundsException
//Ignore NPE, happens sometimes (only 1s long) when somebody is joining, server switching or disconnecting
}
}
}