diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-29 22:25:07 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-29 22:25:07 +0200 |
commit | b6caddc5ad112184fb16f6ff9202cb6dde994ea3 (patch) | |
tree | afbdae582fbd67fb191e63b33b4f3c60ca5a2696 /src/main/java/at/hannibal2 | |
parent | 72db19defaf771fec887af6a9e632e81dc9a8628 (diff) | |
download | skyhanni-b6caddc5ad112184fb16f6ff9202cb6dde994ea3.tar.gz skyhanni-b6caddc5ad112184fb16f6ff9202cb6dde994ea3.tar.bz2 skyhanni-b6caddc5ad112184fb16f6ff9202cb6dde994ea3.zip |
Using 19.9 bps if bps is too low for jacob contest ff needed display
Diffstat (limited to 'src/main/java/at/hannibal2')
-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 +} |