From 45cbc37ab637a11654dcb89b17a0955caa89a973 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 8 Dec 2023 17:10:18 +0100 Subject: Using coerceAtLeast() over max() in that situation --- .../skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt index 62ee1930c..f3ce88b13 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt @@ -17,7 +17,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.math.ceil -import kotlin.math.max class JacobContestFFNeededDisplay { private val config get() = GardenAPI.config @@ -107,8 +106,9 @@ class JacobContestFFNeededDisplay { val counter = map[bracket] ?: return " ${bracket.displayName}§f: §8Not found!" val blocksPerSecond = crop.getRealBlocksPerSecond() val cropsPerSecond = counter.toDouble() / blocksPerSecond / 60 - val farmingFortune = formatFarmingFortune(max(0.0, (cropsPerSecond * 100 / 20 / crop.baseDrops) - 100)) - return " ${bracket.displayName}§f: §6$farmingFortune FF §7(${counter.addSeparators()} crops)" + val farmingFortune = (cropsPerSecond * 100 / 20 / crop.baseDrops) - 100 + val format = formatFarmingFortune(farmingFortune.coerceAtLeast(0.0)) + return " ${bracket.displayName}§f: §6$format FF §7(${counter.addSeparators()} crops)" } @SubscribeEvent -- cgit