diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 8c18659d0..c12710a4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -101,7 +101,16 @@ class GardenAPI { return -1 } - fun CropType.getSpeed() = cropsPerSecond[this]!! + fun CropType.getSpeed(): Int { + val speed = cropsPerSecond[this] + if (speed != null) return speed + + val message = "Set speed for $this to -1!" + println(message) + LorenzUtils.debug(message) + setSpeed(-1) + return -1 + } fun CropType.setSpeed(speed: Int) { cropsPerSecond[this] = speed |