aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-04-27 13:13:49 +0200
committerGitHub <noreply@github.com>2024-04-27 13:13:49 +0200
commit6bb7d33f40ab6b074c7ae3c30d9613fa3e42edf4 (patch)
tree430771da01136b5d7db9191053f4b48a164eb5c1 /src/main/java/at
parent14af92c43ad5d866fa6f9108336e78cb7edff889 (diff)
downloadskyhanni-6bb7d33f40ab6b074c7ae3c30d9613fa3e42edf4.tar.gz
skyhanni-6bb7d33f40ab6b074c7ae3c30d9613fa3e42edf4.tar.bz2
skyhanni-6bb7d33f40ab6b074c7ae3c30d9613fa3e42edf4.zip
Improvement: Added option to disable custom keybinds while on the barn plot. (#1559)
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/KeyBindConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt2
2 files changed, 7 insertions, 1 deletions
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