aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralexia <me@alexia.lol>2024-02-12 20:47:06 +0100
committerGitHub <noreply@github.com>2024-02-12 20:47:06 +0100
commit0a12055a788865ab37483695e2f3c18175b79ae0 (patch)
tree3bd13dafd9cc363853eb47b0ed28c3bed61661fa /src
parent958fd0c3a1f92e7fbc902a74ae0991829f66eede (diff)
downloadNotEnoughUpdates-0a12055a788865ab37483695e2f3c18175b79ae0.tar.gz
NotEnoughUpdates-0a12055a788865ab37483695e2f3c18175b79ae0.tar.bz2
NotEnoughUpdates-0a12055a788865ab37483695e2f3c18175b79ae0.zip
Fix nucleus runs completed (#1016)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java
index 4940e96b..dd626796 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java
@@ -41,6 +41,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
+import java.util.stream.Stream;
public class MiningPage extends GuiProfileViewerPage {
@@ -97,8 +98,10 @@ public class MiningPage extends GuiProfileViewerPage {
"powder_spent_gemstone"
), 0);
- float crystalPlacedAmount =
- Utils.getElementAsFloat(Utils.getElement(miningCore, "crystals.jade_crystal.total_placed"), 0);
+ double nucleusRunsCompleted = Stream.of("amber", "amethyst", "jade", "sapphire", "topaz")
+ .mapToDouble(crystal -> Utils.getElementAsFloat(Utils.getElement(miningCore, "crystals." + crystal + "_crystal.total_placed"), 0))
+ .min()
+ .orElse(0);
int miningFortune = Utils.getElementAsInt(Utils.getElement(nodes, "mining_fortune"), 0);
int miningFortuneStat = miningFortune * 5;
@@ -211,8 +214,8 @@ public class MiningPage extends GuiProfileViewerPage {
}
Utils.renderAlignedString(
- EnumChatFormatting.BLUE + "Total Placed Crystals:",
- EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(crystalPlacedAmount),
+ EnumChatFormatting.BLUE + "Nucleus Runs Completed:",
+ EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(nucleusRunsCompleted),
guiLeft + xStart,
guiTop + yStartTop + 149,
110