Skip to content

Commit

Permalink
fix(AutoWalk): Calculate x & z on first tick
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koppchen authored and MineGame159 committed Jul 16, 2024
1 parent 17ec839 commit babc0c4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit babc0c4

Please sign in to comment.