From c5357ddba6f5713c383c81805d12ca3a0658b89f Mon Sep 17 00:00:00 2001 From: Jim Krok Date: Mon, 8 Jul 2024 20:12:05 -0400 Subject: [PATCH] fix(AutoWalk): Calculate x & z on first tick Calculate x & z on first tick() in the BaritonePathManager GoalDirection class, to fix AutoWalk smart mode so baritone walks in the direction the player is facing. This fixes an issue where smart mode always starts walking towards 0,0. --- .../meteorclient/pathing/BaritonePathManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/pathing/BaritonePathManager.java b/src/main/java/meteordevelopment/meteorclient/pathing/BaritonePathManager.java index 408c7288f0..742f707a88 100644 --- a/src/main/java/meteordevelopment/meteorclient/pathing/BaritonePathManager.java +++ b/src/main/java/meteordevelopment/meteorclient/pathing/BaritonePathManager.java @@ -178,8 +178,8 @@ public static double calculate(double xDiff, double zDiff) { } public void tick() { - if (timer > 20) { - timer = 0; + if (timer <= 0) { + timer = 20; Vec3d pos = mc.player.getPos(); float theta = (float) Math.toRadians(yaw); @@ -188,7 +188,7 @@ public void tick() { z = (int) Math.floor(pos.z + (double) MathHelper.cos(theta) * 100); } - timer++; + timer--; } public boolean isInGoal(int x, int y, int z) {