aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-11-25 14:06:34 +0100
committerGitHub <noreply@github.com>2023-11-26 00:06:34 +1100
commitc202b3d7a7d5fdcaac6ed466d16b04928a5d6bdf (patch)
treeb217e2821866680aeddfe6a295e0f47b3fa1816f /src/main/java/io
parent73ee7b53c360bb910f09190b4e01f214112c44cd (diff)
downloadNotEnoughUpdates-c202b3d7a7d5fdcaac6ed466d16b04928a5d6bdf.tar.gz
NotEnoughUpdates-c202b3d7a7d5fdcaac6ed466d16b04928a5d6bdf.tar.bz2
NotEnoughUpdates-c202b3d7a7d5fdcaac6ed466d16b04928a5d6bdf.zip
Fixed crash with grubber_stacks (#947)
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
index e12c91fb..d2242f87 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
@@ -213,15 +213,9 @@ public class RiftPage extends GuiProfileViewerPage {
renderItem("GLASS", 316, 36, guiLeft, guiTop);
}
- JsonObject castleData = riftData.getAsJsonObject("castle");
+ int grubberStacks = Utils.getElementAsInt(Utils.getElement(profileInfo, "rift.castle.grubber_stacks"), 0);
- int grubberStacks = 0;
- if (castleData.has("grubber_stacks")) {
- grubberStacks = castleData.get("grubber_stacks").getAsInt();
- }
-
- Utils.renderAlignedString(
- EnumChatFormatting.GOLD + "Burger:",
+ Utils.renderAlignedString(EnumChatFormatting.GOLD + "Burger:",
EnumChatFormatting.WHITE.toString() + grubberStacks + "/5",
guiLeft + 331,
guiTop + 87,