From dcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:21:08 +0000 Subject: Made essence show 0 in pv instead of not rendering that line (#408) --- .../notenoughupdates/profileviewer/ExtraPage.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 64afdb75..1936e9c3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -131,17 +131,16 @@ public class ExtraPage extends GuiProfileViewerPage { return; } String displayName = itemInformation.get(essenceName).getAsJsonObject().get("displayname").getAsString(); - if (profileInfo.has(essenceName.toLowerCase())) { - int essenceNumber = profileInfo.get(essenceName.toLowerCase()).getAsInt(); + int essenceNumber = + (profileInfo.has(essenceName.toLowerCase()) ? profileInfo.get(essenceName.toLowerCase()).getAsInt() : 0); - Utils.renderAlignedString( - EnumChatFormatting.GOLD + displayName, - EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(essenceNumber, 0), - guiLeft + xStart + xOffset, - guiTop + yStartTop + yOffset * i, - 76 - ); - } + Utils.renderAlignedString( + EnumChatFormatting.GOLD + displayName, + EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(essenceNumber, 0), + guiLeft + xStart + xOffset, + guiTop + yStartTop + yOffset * i, + 76 + ); } } -- cgit