From 66add9089c89f229ada73a074434a184f72653bc Mon Sep 17 00:00:00 2001 From: test Date: Mon, 19 Aug 2024 12:20:27 +1000 Subject: [PATCH] Update NationUpdateProcessor.java --- .../util/update/NationUpdateProcessor.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/link/locutus/discord/util/update/NationUpdateProcessor.java b/src/main/java/link/locutus/discord/util/update/NationUpdateProcessor.java index 812cd8ab..10a6cb1e 100644 --- a/src/main/java/link/locutus/discord/util/update/NationUpdateProcessor.java +++ b/src/main/java/link/locutus/discord/util/update/NationUpdateProcessor.java @@ -48,15 +48,7 @@ import java.io.IOException; import java.nio.ByteBuffer; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.function.BiConsumer; @@ -749,7 +741,10 @@ private static void checkExodus(DBNation previous, DBNation current) { long now = System.currentTimeMillis(); long cutoff = now - TimeUnit.DAYS.toMillis(1); List removes = new ArrayList<>(alliance.getRankChanges(cutoff)); - Map changesByNation = removes.stream().collect(Collectors.toMap(AllianceChange::getNationId, f -> f)); + Map changesByNation = new LinkedHashMap<>(); + for (AllianceChange change : removes) { + changesByNation.put(change.getNationId(), change); + } changesByNation.put(current.getNation_id(), new AllianceChange(previous, current, now)); for (Map.Entry entry : changesByNation.entrySet()) {