aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
index 1cb015c5..82c9b3b6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
@@ -20,7 +20,6 @@
package io.github.moulberry.notenoughupdates.listener;
import com.google.common.collect.Lists;
-import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NEUApi;
import io.github.moulberry.notenoughupdates.NEUOverlay;
@@ -96,6 +95,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -749,7 +749,7 @@ public class RenderListener {
valueStringBIN1 = EnumChatFormatting.YELLOW + "Value (BIN): ";
valueStringBIN2 = EnumChatFormatting.GOLD + formatCoins(totalValue) + " coins";
} else {
- valueStringBIN1 = EnumChatFormatting.YELLOW + "Can't find BIN: ";
+ valueStringBIN1 = EnumChatFormatting.YELLOW + "Can't find Price: ";
valueStringBIN2 = missingItem;
}
@@ -834,11 +834,12 @@ public class RenderListener {
160
);
}
- JsonObject mayorJson = SBInfo.getInstance().getMayorJson();
- JsonElement mayor = mayorJson.get("mayor");
- if (mayorJson.has("mayor") && mayor != null && mayor.getAsJsonObject().has("name") &&
- mayor.getAsJsonObject().get("name").getAsString().equals("Derpy")
- && NotEnoughUpdates.INSTANCE.config.dungeons.shouldWarningDerpy) {
+ String mayorJson = Utils.getElementAsString(
+ Utils.getElement(SBInfo.getInstance().getMayorJson(), "mayor.name"),
+ ""
+ );
+ if (Objects.equals(mayorJson, "Derpy") &&
+ NotEnoughUpdates.INSTANCE.config.dungeons.shouldWarningDerpy) {
Utils.drawStringScaled(
EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "Mayor Derpy active!",
guiLeft + xSize + 4 + 10,