From 8ca43ebe02657ca9e872b568dca366ab27f2959e Mon Sep 17 00:00:00 2001 From: vicisacat Date: Tue, 26 Mar 2024 18:10:40 +0100 Subject: [PATCH] did the do --- .../de/hysky/skyblocker/config/SkyblockerConfig.java | 2 +- .../config/categories/LocationsCategory.java | 6 +++--- .../skyblocker/skyblock/garden/LowerSensitivity.java | 11 +++-------- src/main/resources/assets/skyblocker/lang/en_us.json | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 1d0765fbd7..6da1f46549 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -1099,7 +1099,7 @@ public static class Garden { public boolean lockMouseTool = false; @SerialEntry - public boolean lockMouseGround = false; + public boolean lockMouseGroundOnly = false; } public static class FarmingHud { diff --git a/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java index 9413030c13..67512b7883 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/LocationsCategory.java @@ -175,9 +175,9 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.garden.lockMouseGround")) - .binding(defaults.locations.garden.lockMouseGround, - () -> config.locations.garden.lockMouseGround, - newValue -> config.locations.garden.lockMouseGround = newValue) + .binding(defaults.locations.garden.lockMouseGroundOnly, + () -> config.locations.garden.lockMouseGroundOnly, + newValue -> config.locations.garden.lockMouseGroundOnly = newValue) .controller(ConfigUtils::createBooleanController) .build()) .build()) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/garden/LowerSensitivity.java b/src/main/java/de/hysky/skyblocker/skyblock/garden/LowerSensitivity.java index 0ccd854313..edea50deb5 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/garden/LowerSensitivity.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/garden/LowerSensitivity.java @@ -21,16 +21,11 @@ public static void init() { if (SkyblockerConfigManager.get().locations.garden.lockMouseTool) { ItemStack mainHandStack = MinecraftClient.getInstance().player.getMainHandStack(); String itemId = ItemUtils.getItemId(mainHandStack); - boolean isHoldingTool = FarmingHudWidget.FARMING_TOOLS.containsKey(itemId); - if (isHoldingTool && !sensitivityLowered) lowerSensitivity(true); - else if (!isHoldingTool && sensitivityLowered) lowerSensitivity(false); + boolean shouldLockMouse = FarmingHudWidget.FARMING_TOOLS.containsKey(itemId) && (!SkyblockerConfigManager.get().locations.garden.lockMouseGroundOnly || MinecraftClient.getInstance().player.isOnGround()); + if (shouldLockMouse && !sensitivityLowered) lowerSensitivity(true); + else if (!shouldLockMouse && sensitivityLowered) lowerSensitivity(false); } - if (SkyblockerConfigManager.get().locations.garden.lockMouseGround) { - boolean onGround = MinecraftClient.getInstance().player.isOnGround(); - if (onGround && !sensitivityLowered) lowerSensitivity(true); - else if (!onGround && sensitivityLowered) lowerSensitivity(false); - } }); } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index deeb384d6e..feb635fa57 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -207,7 +207,7 @@ "text.autoconfig.skyblocker.option.locations.garden.dicerTitlePrevent": "Enable Dicer Title Prevent", "text.autoconfig.skyblocker.option.locations.garden.visitorHelper": "Visitor helper", "text.autoconfig.skyblocker.option.locations.garden.lockMouseTool": "Lock camera when holding a farming tool", - "text.autoconfig.skyblocker.option.locations.garden.lockMouseGround": "Lock camera when on the ground", + "text.autoconfig.skyblocker.option.locations.garden.lockMouseGround": "Only lock camera when on the ground", "text.autoconfig.skyblocker.option.locations.dungeons": "Dungeons", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints": "Dungeon Secret Waypoints", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableRoomMatching": "Enable Room Matching",