From 1f99d218c62418a401cd69754e95eef329e3279d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:55:38 +0100 Subject: Updating optimal speed immediately when changing the setting. --- .../garden/optimalspeed/CustomSpeedConfig.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/config/features') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/optimalspeed/CustomSpeedConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/optimalspeed/CustomSpeedConfig.java index 615883c96..768a155a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/optimalspeed/CustomSpeedConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/optimalspeed/CustomSpeedConfig.java @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.config.features.garden.optimalspeed; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.observer.Property; public class CustomSpeedConfig { @@ -11,56 +12,56 @@ public class CustomSpeedConfig { "§e5 Blocks§7: §f✦ 93 speed\n" + "§e4 Blocks§7: §f✦ 116 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int wheat = 93; + public Property wheat = Property.of(93f); @Expose @ConfigOption(name = "Carrot", desc = "Suggested farm speed:\n" + "§e5 Blocks§7: §f✦ 93 speed\n" + "§e4 Blocks§7: §f✦ 116 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int carrot = 93; + public Property carrot = Property.of(93f); @Expose @ConfigOption(name = "Potato", desc = "Suggested farm speed:\n" + "§e5 Blocks§7: §f✦ 93 speed\n" + "§e4 Blocks§7: §f✦ 116 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int potato = 93; + public Property potato = Property.of(93f); @Expose @ConfigOption(name = "Nether Wart", desc = "Suggested farm speed:\n" + "§e5 Blocks§7: §f✦ 93 speed\n" + "§e4 Blocks§7: §f✦ 116 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int netherWart = 93; + public Property netherWart = Property.of(93f); @Expose @ConfigOption(name = "Pumpkin", desc = "Suggested farm speed:\n" + "§e3 Blocks§7: §f✦ 155 speed\n" + "§e2 Blocks§7: §f✦ 265 §7or §f400 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int pumpkin = 155; + public Property pumpkin = Property.of(155f); @Expose @ConfigOption(name = "Melon", desc = "Suggested farm speed:\n" + "§e3 Blocks§7: §f✦ 155 speed\n" + "§e2 Blocks§7: §f✦ 265 or 400 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int melon = 155; + public Property melon = Property.of(155f); @Expose @ConfigOption(name = "Cocoa Beans", desc = "Suggested farm speed:\n" + "§e3 Blocks§7: §f✦ 155 speed\n" + "§e4 Blocks§7: §f✦ 116 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int cocoaBeans = 155; + public Property cocoaBeans = Property.of(155f); // TODO does other speed settings exist? @Expose @ConfigOption(name = "Sugar Cane", desc = "Suggested farm speed:\n" + "§eYaw 45§7: §f✦ 328 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int sugarCane = 328; + public Property sugarCane = Property.of(328f); @Expose @ConfigOption(name = "Cactus", desc = "Suggested farm speed:\n" + @@ -68,12 +69,12 @@ public class CustomSpeedConfig { "§eRacing Helmet§7: §f✦ 464 speed\n" + "§eBlack Cat§7: §f✦ 464 speed") @ConfigEditorSlider(minValue = 1, maxValue = 500, minStep = 1) - public int cactus = 400; + public Property cactus = Property.of(400f); // TODO does other speed settings exist? @Expose @ConfigOption(name = "Mushroom", desc = "Suggested farm speed:\n" + "§eYaw 60§7: §f✦ 233 speed") @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int mushroom = 233; + public Property mushroom = Property.of(233f); } -- cgit