aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-23 16:52:17 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-23 16:52:17 +0200
commitd16891c6c1e46ca8356deb5685f1551e32ecee45 (patch)
treef63cd39257058d9794fec4258d7723fdd8f89b0a /src/main/java
parentb13a72bf24976e0e0a2ec35d71f6d3626303fc60 (diff)
downloadskyhanni-d16891c6c1e46ca8356deb5685f1551e32ecee45.tar.gz
skyhanni-d16891c6c1e46ca8356deb5685f1551e32ecee45.tar.bz2
skyhanni-d16891c6c1e46ca8356deb5685f1551e32ecee45.zip
Only show mushroom cow perk eta when block speed is loaded
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
index 4a12ac29d..02172ac8e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
@@ -340,12 +340,6 @@ class GardenCropMilestoneDisplay {
val missing = need - have
- val blocksPerSecond = averageBlocksPerSecond * (currentCrop?.multiplier ?: 1)
-
- val missingTimeSeconds = missing / blocksPerSecond
- val millis = missingTimeSeconds * 1000
- val duration = TimeUtils.formatDuration(millis.toLong())
-
lineMap[0] = Collections.singletonList("§6Mooshroom Cow Perk")
val list = mutableListOf<Any>()
@@ -354,7 +348,16 @@ class GardenCropMilestoneDisplay {
lineMap[1] = list
lineMap[2] = Collections.singletonList("§e$haveFormat§8/§e$needFormat")
- lineMap[3] = Collections.singletonList("§7In §b$duration")
+
+
+ if (averageBlocksPerSecond != 0.0) {
+ val blocksPerSecond = averageBlocksPerSecond * (currentCrop?.multiplier ?: 1)
+
+ val missingTimeSeconds = missing / blocksPerSecond
+ val millis = missingTimeSeconds * 1000
+ val duration = TimeUtils.formatDuration(millis.toLong())
+ lineMap[3] = Collections.singletonList("§7In §b$duration")
+ }
val percentageFormat = LorenzUtils.formatPercentage(have.toDouble() / need.toDouble())
lineMap[4] = Collections.singletonList("§7Percentage: §e$percentageFormat")