From 0a12055a788865ab37483695e2f3c18175b79ae0 Mon Sep 17 00:00:00 2001 From: alexia Date: Mon, 12 Feb 2024 20:47:06 +0100 Subject: Fix nucleus runs completed (#1016) --- .../moulberry/notenoughupdates/profileviewer/MiningPage.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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 -- cgit