diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt | 21 |
1 files changed, 16 insertions, 5 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 09f7bde19..a2b5c10a8 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 @@ -71,12 +71,16 @@ class JacobContestFFNeededDisplay { } addAsSingletonList("") - val blocksPerSecond = crop.getLatestBlocksPerSecond() + var blocksPerSecond = crop.getLatestBlocksPerSecond() if (blocksPerSecond == null) { add(listOf("§cNo ", crop.icon, "§cblocks/second data,")) - addAsSingletonList("§cassuming 20.") + addAsSingletonList("§cassuming 19.9 instead.") } else { - add(listOf("§7Using latest ", crop.icon, "§7blocks/second: §e${blocksPerSecond.round(2)}")) + if (blocksPerSecond < 15.0) { + add(listOf("§7Your latest ", crop.icon, "§7blocks/second: §e${blocksPerSecond.round(2)}")) + add(listOf("§cThis is too low, showing 19.9 Blocks/second instead!")) + blocksPerSecond = 19.9 + } if (blocksPerSecond < 1) { addAsSingletonList("§cLow blocks per second!") addAsSingletonList("§cFarm this crop for couple more seconds!") @@ -113,7 +117,7 @@ class JacobContestFFNeededDisplay { private fun getLine(bracket: ContestBracket, map: Map<ContestBracket, Int>, crop: CropType): String { val counter = map[bracket]!! - val blocksPerSecond = crop.getLatestBlocksPerSecond() ?: 20.0 + val blocksPerSecond = crop.getRealBlocksPerSecond() val cropsPerSecond = counter.toDouble() / blocksPerSecond / 60 val farmingFortune = formatFarmingFortune(cropsPerSecond * 100 / 20 / crop.baseDrops) return " ${bracket.displayName}§f: §6$farmingFortune FF §7(${counter.addSeparators()} crops)" @@ -128,4 +132,11 @@ class JacobContestFFNeededDisplay { } fun isEnabled() = LorenzUtils.inSkyBlock && config.farmingFortuneForContest -}
\ No newline at end of file +} + +private fun CropType.getRealBlocksPerSecond(): Double { + val bps = getLatestBlocksPerSecond() ?: 20.0 + return if (bps < 15.0) { + return 19.9 + } else bps +} |