diff --git a/build.gradle b/build.gradle index 2873db7f..384925b3 100644 --- a/build.gradle +++ b/build.gradle @@ -111,7 +111,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-core:2.23.1' implementation 'org.apache.logging.log4j:log4j-api:2.13.3' - + implementation 'commons-logging:commons-logging:1.3.4' implementation 'com.pusher:pusher-java-client:2.4.4' @@ -472,7 +472,7 @@ jar { } shadowJar { - minimize() +// minimize() zip64=true archiveBaseName = "${name}-${project.name}" } diff --git a/src/main/java/link/locutus/discord/util/trade/TradeManager.java b/src/main/java/link/locutus/discord/util/trade/TradeManager.java index a80172de..f7070e5f 100644 --- a/src/main/java/link/locutus/discord/util/trade/TradeManager.java +++ b/src/main/java/link/locutus/discord/util/trade/TradeManager.java @@ -217,6 +217,11 @@ public synchronized TradeManager load() { if (Settings.INSTANCE.TASKS.COMPLETED_TRADES_SECONDS > 0) { updateTradeList(null); } else { + if (low == null) low = new int[ResourceType.values.length]; + if (high == null) high = new int[ResourceType.values.length]; + lowAvg = new double[ResourceType.values.length]; + highAvg = new double[ResourceType.values.length]; + Map initDefaults = new EnumMap<>(ResourceType.class); initDefaults.put(ResourceType.MONEY, 1); initDefaults.put(ResourceType.CREDITS, 25_000_000); @@ -235,6 +240,8 @@ public synchronized TradeManager load() { int def = initDefaults.getOrDefault(type, 3000); low[type.ordinal()] = def; high[type.ordinal()] = def; + lowAvg[type.ordinal()] = def; + highAvg[type.ordinal()] = def; } } } else { @@ -246,7 +253,7 @@ public synchronized TradeManager load() { lowAvg[ResourceType.CREDITS.ordinal()] = 25_000_000; highAvg[0] = 1; highAvg[ResourceType.CREDITS.ordinal()] = 25_000_000; - + loadActiveTrades(); return this; }