diff --git a/Plan/src/main/java/com/djrapitops/plan/ui/html/tables/KillsTableCreator.java b/Plan/src/main/java/com/djrapitops/plan/ui/html/tables/KillsTableCreator.java index 8cc79dbeb..c3a7ca489 100644 --- a/Plan/src/main/java/com/djrapitops/plan/ui/html/tables/KillsTableCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/ui/html/tables/KillsTableCreator.java @@ -6,7 +6,9 @@ import main.java.com.djrapitops.plan.data.KillData; import main.java.com.djrapitops.plan.ui.html.Html; import main.java.com.djrapitops.plan.utilities.FormatUtils; import main.java.com.djrapitops.plan.utilities.HtmlUtils; +import main.java.com.djrapitops.plan.utilities.comparators.KillDataComparator; +import java.util.Collections; import java.util.List; /** @@ -32,6 +34,10 @@ public class KillsTableCreator { html.append(Html.TABLELINE_3.parse(Html.KILLDATA_NONE.parse(), "", "")); } else { int i = 0; + + killData.sort(new KillDataComparator()); + Collections.reverse(killData); + for (KillData kill : killData) { if (i >= 20) { break; diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/KillDataComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/KillDataComparator.java new file mode 100644 index 000000000..42bb5c877 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/KillDataComparator.java @@ -0,0 +1,17 @@ +package main.java.com.djrapitops.plan.utilities.comparators; + +import main.java.com.djrapitops.plan.data.KillData; + +import java.util.Comparator; + +/** + * @author Fuzzlemann + */ +public class KillDataComparator implements Comparator { + + @Override + public int compare(KillData o1, KillData o2) { + return Long.compare(o1.getDate(), o2.getDate()); + } + +}