diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-23 14:55:08 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-23 14:56:43 +0100 |
commit | 5ddccce30b3e285581b42eb1274d98b581635faa (patch) | |
tree | 25f22f37e8a8e413620e99f017412bbe9773787f /src/main/java/at/hannibal2/skyhanni | |
parent | d385aee524e9c9c5178a1c8c7bd34fc4efc9befc (diff) | |
download | skyhanni-5ddccce30b3e285581b42eb1274d98b581635faa.tar.gz skyhanni-5ddccce30b3e285581b42eb1274d98b581635faa.tar.bz2 skyhanni-5ddccce30b3e285581b42eb1274d98b581635faa.zip |
Added CropType.getOptimalSpeed
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt | 4 |
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 |