Skip to content

Commit

Permalink
did the do
Browse files Browse the repository at this point in the history
  • Loading branch information
viciscat committed Mar 26, 2024
1 parent eee7360 commit 8ca43eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.build())
.option(Option.<Boolean>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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8ca43eb

Please sign in to comment.