From c202b3d7a7d5fdcaac6ed466d16b04928a5d6bdf Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:06:34 +0100 Subject: Fixed crash with grubber_stacks (#947) --- .../notenoughupdates/profileviewer/rift/RiftPage.java | 10 ++-------- 1 file 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, -- cgit