diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-10-31 10:21:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 11:21:08 +0100 |
commit | dcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8 (patch) | |
tree | 99a7d9f48f2c74c6bb685a83ddd108b145272b35 /src/main/java | |
parent | 6814410aec2fc2fd3b214dbb84aa502ffbbb8ac4 (diff) | |
download | NotEnoughUpdates-dcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8.tar.gz NotEnoughUpdates-dcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8.tar.bz2 NotEnoughUpdates-dcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8.zip |
Made essence show 0 in pv instead of not rendering that line (#408)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | 19 |
1 files changed, 9 insertions, 10 deletions
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 + ); } } |