aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-08 17:10:18 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-08 17:10:18 +0100
commit45cbc37ab637a11654dcb89b17a0955caa89a973 (patch)
tree66494054b33c90eb9c93a4272a06831c07231290
parentc6a0603c22b31cab027ffa463ed7f01e363ebe09 (diff)
downloadskyhanni-45cbc37ab637a11654dcb89b17a0955caa89a973.tar.gz
skyhanni-45cbc37ab637a11654dcb89b17a0955caa89a973.tar.bz2
skyhanni-45cbc37ab637a11654dcb89b17a0955caa89a973.zip
Using coerceAtLeast() over max() in that situation
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt6
1 files 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