diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index 9d09880e3..535163f81 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -309,7 +309,19 @@ object FarmingWeightDisplay { } val timeFormat = if (weightPerSecond != -1.0) { - val timeTillOvertake = (weightUntilOvertake / weightPerSecond).minutes + val timeTillOvertake = try { + (weightUntilOvertake / weightPerSecond).minutes + } catch (e: Exception) { + ErrorManager.logErrorWithData( + e, + "Error calculating Farming ETA duration", + "weightPerSecond" to weightPerSecond, + "weightUntilOvertake" to weightUntilOvertake, + "totalWeight" to totalWeight, + "nextPlayer.weight" to nextPlayer.weight, + ) + return null + } val format = timeTillOvertake.format() " §7(§b$format§7)" } else "" |