aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-08-06 04:06:11 +1000
committerGitHub <noreply@github.com>2023-08-05 20:06:11 +0200
commitc90c4c0c4d72dc3427a4173d806873a994b92e6a (patch)
treec9ed82b76baa5be616be78797869939193256369 /src/main/java
parent898f06f6b4daddd8b33560804f421bbd55338b0a (diff)
downloadNotEnoughUpdates-c90c4c0c4d72dc3427a4173d806873a994b92e6a.tar.gz
NotEnoughUpdates-c90c4c0c4d72dc3427a4173d806873a994b92e6a.tar.bz2
NotEnoughUpdates-c90c4c0c4d72dc3427a4173d806873a994b92e6a.zip
fix crash with copper overlay (#790)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/GardenNpcPrices.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/GardenNpcPrices.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/GardenNpcPrices.java
index d08cb1a5..789657f5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/GardenNpcPrices.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/GardenNpcPrices.java
@@ -20,8 +20,8 @@
package io.github.moulberry.notenoughupdates.miscfeatures;
import com.google.common.reflect.TypeToken;
-import com.google.gson.GsonBuilder;
import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe;
import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent;
@@ -120,6 +120,7 @@ public class GardenNpcPrices {
double price = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarOrBin(internalName, false) /item.price*amount;
prices.put(item.display, price);
}
+ if (prices.isEmpty()) return new net.minecraft.util.Tuple<String, Double>("NEU REPO error", 0d);
Map.Entry<String, Double> maxPrice = Collections.max(prices.entrySet(), Map.Entry.comparingByValue());
return new net.minecraft.util.Tuple<String, Double>(maxPrice.getKey(), maxPrice.getValue());
}