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/profileviewer/ExtraPage.java19
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
+ );
}
}