diff --git a/src/main/java/cc/fascinated/piaservers/readme/ReadMeManager.java b/src/main/java/cc/fascinated/piaservers/readme/ReadMeManager.java index 57ccfbc..02d066e 100644 --- a/src/main/java/cc/fascinated/piaservers/readme/ReadMeManager.java +++ b/src/main/java/cc/fascinated/piaservers/readme/ReadMeManager.java @@ -42,6 +42,7 @@ public class ReadMeManager { regionCounts.put(region, regionCounts.getOrDefault(region, 0) + 1); } contents = contents.replace("{server_table}", regionCounts.entrySet().stream() + .sorted((a, b) -> Integer.compare(b.getValue(), a.getValue())) // Sort from highest to lowest .map(entry -> "| " + entry.getKey() + " | " + entry.getValue() + " |") // Map the region to the count .reduce((a, b) -> a + "\n" + b).orElse("")); // Reduce the entries to a single string