Add activity priority to world list

Adds a special sorting case for empty worlds. They should remain at the bottom of the world list.
This commit is contained in:
psikoi
2018-08-16 16:57:59 +01:00
parent 23608bef5b
commit 7033e4632a

View File

@@ -130,6 +130,12 @@ class WorldSwitcherPanel extends PluginPanel
}
});
// Leave empty activity worlds on the bottom of the list
if (orderIndex == WorldOrder.ACTIVITY)
{
rows.sort((r1, r2) -> r1.getWorld().getActivity().equals("-") ? 1 : -1);
}
rows.sort((r1, r2) ->
{
boolean b1 = plugin.isFavorite(r1.getWorld());