From 6bb7d33f40ab6b074c7ae3c30d9613fa3e42edf4 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sat, 27 Apr 2024 13:13:49 +0200 Subject: Improvement: Added option to disable custom keybinds while on the barn plot. (#1559) --- .../at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java | 6 ++++++ .../skyhanni/features/garden/farming/GardenCustomKeybinds.kt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java index 80bfcf3a7..e2e695103 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java @@ -16,6 +16,12 @@ public class KeyBindConfig { @FeatureToggle public boolean enabled = false; + @Expose + @ConfigOption(name = "Exclude Barn", desc = "Disable this feature while on the barn plot.") + @ConfigEditorBoolean + @FeatureToggle + public boolean excludeBarn = false; + @ConfigOption(name = "Disable All", desc = "Disable all keys.") @ConfigEditorButton(buttonText = "Disable") public Runnable presetDisable = () -> { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt index b696d05ba..f4a401cd5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt @@ -36,7 +36,7 @@ object GardenCustomKeybinds { map[mcSettings.keyBindSneak] = { config.sneak } } - private fun isEnabled() = GardenAPI.inGarden() && config.enabled + private fun isEnabled() = GardenAPI.inGarden() && config.enabled && !(GardenAPI.onBarnPlot && config.excludeBarn) private fun isActive(): Boolean { if (!isEnabled()) return false -- cgit