Put worlds with unknown ping at the bottom of the world hopper list

Closes #8176
This commit is contained in:
Su-Shing Chen
2019-06-08 16:11:41 +12:00
parent 7c56748377
commit 799158bacd

View File

@@ -161,7 +161,12 @@ class WorldSwitcherPanel extends PluginPanel
switch (orderIndex)
{
case PING:
return getCompareValue(r1, r2, WorldTableRow::getPing);
// Leave worlds with unknown ping at the bottom
return getCompareValue(r1, r2, row ->
{
int ping = row.getPing();
return ping > 0 ? ping : null;
});
case WORLD:
return getCompareValue(r1, r2, row -> row.getWorld().getId());
case PLAYERS: