diff --git a/src/com/massivecraft/factions/cmd/CmdList.java b/src/com/massivecraft/factions/cmd/CmdList.java index 5d595614..fd120708 100644 --- a/src/com/massivecraft/factions/cmd/CmdList.java +++ b/src/com/massivecraft/factions/cmd/CmdList.java @@ -48,9 +48,11 @@ public class CmdList extends FCommand Collections.sort(factionList, new Comparator(){ @Override public int compare(Faction f1, Faction f2) { - if (f1.getFPlayers().size() < f2.getFPlayers().size()) + int f1Size = f1.getFPlayers().size(); + int f2Size = f2.getFPlayers().size(); + if (f1Size < f2Size) return 1; - else if (f1.getFPlayers().size() > f2.getFPlayers().size()) + else if (f1Size > f2Size) return -1; return 0; } @@ -60,9 +62,11 @@ public class CmdList extends FCommand Collections.sort(factionList, new Comparator(){ @Override public int compare(Faction f1, Faction f2) { - if (f1.getFPlayersWhereOnline(true).size() < f2.getFPlayersWhereOnline(true).size()) + int f1Size = f1.getFPlayersWhereOnline(true).size(); + int f2Size = f2.getFPlayersWhereOnline(true).size(); + if (f1Size < f2Size) return 1; - else if (f1.getFPlayersWhereOnline(true).size() > f2.getFPlayersWhereOnline(true).size()) + else if (f1Size > f2Size) return -1; return 0; }