diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt index 0124d75ca..2ff5706b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt @@ -68,7 +68,7 @@ object GardenCropSpeed { if (blocksBroken == 0) { if (blocksSpeedList.size == 0) return - secondsStopped ++ + secondsStopped++ } else { if (secondsStopped >= config.blocksBrokenResetTime) { resetSpeed() @@ -82,7 +82,9 @@ object GardenCropSpeed { blocksSpeedList.removeFirst() blocksSpeedList.add(blocksBroken) } - averageBlocksPerSecond = blocksSpeedList.dropLast(1).average() + averageBlocksPerSecond = if (blocksSpeedList.size > 1) { + blocksSpeedList.dropLast(1).average() + } else 0.0 GardenAPI.getCurrentlyFarmedCrop()?.let { latestBlocksPerSecond[it] = averageBlocksPerSecond } |