aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLulonaut <lulonaut@tutanota.de>2022-12-07 03:50:57 +0100
committerGitHub <noreply@github.com>2022-12-07 13:50:57 +1100
commit377df44813f057405ce6b09cee73eab9755384ab (patch)
tree5db0a5b49777c5832b78e69f7d36512b5b3e0086 /src
parent66741353bba3bb97b223c41bfc200b9ee04d5c7e (diff)
downloadNotEnoughUpdates-377df44813f057405ce6b09cee73eab9755384ab.tar.gz
NotEnoughUpdates-377df44813f057405ce6b09cee73eab9755384ab.tar.bz2
NotEnoughUpdates-377df44813f057405ce6b09cee73eab9755384ab.zip
show wither essence in /pv (#466)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java12
1 files changed, 7 insertions, 5 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 1936e9c3..21ccc683 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
@@ -112,16 +112,18 @@ public class ExtraPage extends GuiProfileViewerPage {
) {
int guiLeft = GuiProfileViewer.getGuiLeft();
int guiTop = GuiProfileViewer.getGuiTop();
- yStartTop = yStartTop + 78;
+ yStartTop += 77;
if (Constants.PARENTS == null || !Constants.PARENTS.has("ESSENCE_WITHER")) {
Utils.showOutdatedRepoNotification();
return;
}
JsonObject parents = Constants.PARENTS;
- JsonArray essenceArray = parents.get("ESSENCE_WITHER").getAsJsonArray();
+ JsonArray essenceArray = new JsonArray();
+ essenceArray.addAll(parents.get("ESSENCE_WITHER").getAsJsonArray());
+ //add wither essence since it's not part of the parents array
+ essenceArray.add(new JsonPrimitive("ESSENCE_WITHER"));
for (int i = 0; i < essenceArray.size(); i++) {
-
JsonElement jsonElement = essenceArray.get(i);
String essenceName = jsonElement.getAsString();
@@ -132,13 +134,13 @@ public class ExtraPage extends GuiProfileViewerPage {
}
String displayName = itemInformation.get(essenceName).getAsJsonObject().get("displayname").getAsString();
int essenceNumber =
- (profileInfo.has(essenceName.toLowerCase()) ? profileInfo.get(essenceName.toLowerCase()).getAsInt() : 0);
+ 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,
+ guiTop + yStartTop + (yOffset - 1) * i,
76
);
}