diff options
author | alexia <me@alexia.lol> | 2023-12-08 17:08:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 17:08:37 +0100 |
commit | c6a0603c22b31cab027ffa463ed7f01e363ebe09 (patch) | |
tree | 1c5cf18605c1b5b4630780ac168df1d103c54133 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 6bca12c94980771cd85ebfc94417a8b41bd1d8c9 (diff) | |
download | skyhanni-c6a0603c22b31cab027ffa463ed7f01e363ebe09.tar.gz skyhanni-c6a0603c22b31cab027ffa463ed7f01e363ebe09.tar.bz2 skyhanni-c6a0603c22b31cab027ffa463ed7f01e363ebe09.zip |
Fix FF needed calculations (#774)
Fixed wrong base 100ff calculations in the farming fortune needed display. #774
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt | 5 |
1 files changed, 3 insertions, 2 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 e52a1b343..62ee1930c 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,6 +17,7 @@ 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 @@ -95,7 +96,7 @@ class JacobContestFFNeededDisplay { if (blocksPerSecond == null || trueFF == null) { add(listOf("§cMissing data from above!")) } else { - val predictedScore = (trueFF * blocksPerSecond * crop.baseDrops * 20 * 60 / 100).toInt().addSeparators() + val predictedScore = ((100.0 + trueFF) * blocksPerSecond * crop.baseDrops * 20 * 60 / 100).toInt().addSeparators() add(listOf("§6Predicted ", crop.icon, "§6crops: $predictedScore")) } } @@ -106,7 +107,7 @@ 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(cropsPerSecond * 100 / 20 / crop.baseDrops) + val farmingFortune = formatFarmingFortune(max(0.0, (cropsPerSecond * 100 / 20 / crop.baseDrops) - 100)) return " ${bracket.displayName}§f: §6$farmingFortune FF §7(${counter.addSeparators()} crops)" } |