aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
index cad800cbe..271bab488 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
@@ -33,11 +33,11 @@ class GardenOptimalSpeed {
fun onGardenToolChange(event: GardenToolChangeEvent) {
cropInHand = event.crop
if (isEnabled()) {
- optimalSpeed = cropInHand.let { if (it != null) speedForCrop(it) else -1 }
+ optimalSpeed = cropInHand.let { it?.getOptimalSpeed() ?: -1 }
}
}
- private fun speedForCrop(crop: CropType) = when (crop) {
+ private fun CropType.getOptimalSpeed() = when (this) {
CropType.WHEAT -> 93
CropType.CARROT -> 93
CropType.POTATO -> 93