Sorted nicknames most recent first /player page

This commit is contained in:
Rsl1122 2019-09-15 15:38:19 +03:00
parent 004364ca61
commit 03fcd5e893

View File

@ -38,6 +38,7 @@ import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.storage.database.Database; import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.containers.PlayerContainerQuery; import com.djrapitops.plan.storage.database.queries.containers.PlayerContainerQuery;
import com.djrapitops.plan.storage.database.queries.objects.ServerQueries; import com.djrapitops.plan.storage.database.queries.objects.ServerQueries;
import com.djrapitops.plan.utilities.comparators.DateHolderRecentComparator;
import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import javax.inject.Inject; import javax.inject.Inject;
@ -275,6 +276,7 @@ public class PlayerJSONParser {
Map<UUID, String> serverNames, Map<UUID, String> serverNames,
Formatter<Long> dateFormatter Formatter<Long> dateFormatter
) { ) {
nicknames.sort(new DateHolderRecentComparator());
List<Nickname> mapped = new ArrayList<>(); List<Nickname> mapped = new ArrayList<>();
for (com.djrapitops.plan.delivery.domain.Nickname nickname : nicknames) { for (com.djrapitops.plan.delivery.domain.Nickname nickname : nicknames) {
mapped.add(new Nickname( mapped.add(new Nickname(