Fix friend sorting

This commit is contained in:
Sam 2018-08-21 22:48:51 +01:00 committed by Alexander Meech
parent 54f2c29254
commit 16b187d41a
2 changed files with 5 additions and 5 deletions

View File

@ -65,14 +65,14 @@ public class FriendManager extends MiniDbClientPlugin<List<FriendStatus>>
JOIN_STAFF
}
private static final int MAX_FRIENDS = 500;
private static final int MAX_FRIENDS = 1000;
private static final long COOLDOWN = TimeUnit.SECONDS.toMillis(5);
private static final Comparator<FriendStatus> FRIEND_SORTER = (o1, o2) ->
{
// If not mutual
if (o1.Status != FriendStatusType.Accepted || o2.Status != FriendStatusType.Accepted)
{
return o1.Name.compareTo(o2.Name);
return o1.Name.compareToIgnoreCase(o2.Name);
}
// Online
@ -96,7 +96,7 @@ public class FriendManager extends MiniDbClientPlugin<List<FriendStatus>>
}
// Name
return o1.Name.compareTo(o2.Name);
return o1.Name.compareToIgnoreCase(o2.Name);
};
public static Comparator<FriendStatus> getFriendSorter()

View File

@ -116,12 +116,12 @@ public class FriendMainPage extends ShopPageBase<FriendManager, FriendShop>
slot = 47;
FriendVisibility playerVisiblity = getPlugin().getVisibility(getPlayer());
FriendVisibility playerVisibility = getPlugin().getVisibility(getPlayer());
for (FriendVisibility visibility : FriendVisibility.values())
{
addButton(slot, new ItemBuilder(visibility.getItemStack())
.setGlow(visibility == playerVisiblity)
.setGlow(visibility == playerVisibility)
.build(), (player, clickType) ->
{
getPlugin().setVisibility(player, visibility);