aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt25
1 files changed, 13 insertions, 12 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 a4a326ad2..c0ce6e821 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
@@ -97,19 +97,20 @@ class GardenOptimalSpeed {
private fun CropType.getOptimalSpeed() = getConfig().get().toInt()
- private fun CropType.getConfig(): Property<Float> =
- when (this) {
- CropType.WHEAT -> configCustomSpeed.wheat
- CropType.CARROT -> configCustomSpeed.carrot
- CropType.POTATO -> configCustomSpeed.potato
- CropType.NETHER_WART -> configCustomSpeed.netherWart
- CropType.PUMPKIN -> configCustomSpeed.pumpkin
- CropType.MELON -> configCustomSpeed.melon
- CropType.COCOA_BEANS -> configCustomSpeed.cocoaBeans
- CropType.SUGAR_CANE -> configCustomSpeed.sugarCane
- CropType.CACTUS -> configCustomSpeed.cactus
- CropType.MUSHROOM -> configCustomSpeed.mushroom
+ private fun CropType.getConfig(): Property<Float> = with(configCustomSpeed) {
+ when (this@getConfig) {
+ CropType.WHEAT -> wheat
+ CropType.CARROT -> carrot
+ CropType.POTATO -> potato
+ CropType.NETHER_WART -> netherWart
+ CropType.PUMPKIN -> pumpkin
+ CropType.MELON -> melon
+ CropType.COCOA_BEANS -> cocoaBeans
+ CropType.SUGAR_CANE -> sugarCane
+ CropType.CACTUS -> cactus
+ CropType.MUSHROOM -> mushroom
}
+ }
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {