From 603b33277c91e68d42ac6ae9c486980cdb35d1b8 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 5 Aug 2018 22:00:37 -0400 Subject: [PATCH] player, not center of player feet --- .../bot/pathing/movement/movements/MovementAscend.java | 3 ++- .../bot/pathing/movement/movements/MovementTraverse.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java b/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java index 6c5ed32c..23344b7f 100644 --- a/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java +++ b/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java @@ -10,6 +10,7 @@ import baritone.bot.utils.ToolSet; import baritone.bot.utils.Utils; import net.minecraft.block.BlockFalling; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import java.util.Optional; @@ -78,7 +79,7 @@ public class MovementAscend extends Movement { return state; } - state.setTarget(new MovementState.MovementTarget(Optional.empty(), Optional.of(Utils.calcRotationFromCoords(playerFeet(), positionsToBreak[0])))); + state.setTarget(new MovementState.MovementTarget(Optional.empty(), Optional.of(Utils.calcRotationFromVec3d(new Vec3d(player().posX, player().posY, player().posZ), Utils.calcCenterFromCoords(positionsToBreak[1], world()))))); state.setInput(InputOverrideHandler.Input.JUMP, true).setInput(InputOverrideHandler.Input.MOVE_FORWARD, true); return state; default: diff --git a/src/main/java/baritone/bot/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/bot/pathing/movement/movements/MovementTraverse.java index 78c61f4e..a442aa41 100644 --- a/src/main/java/baritone/bot/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/bot/pathing/movement/movements/MovementTraverse.java @@ -14,6 +14,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import java.util.Optional; @@ -97,7 +98,7 @@ public class MovementTraverse extends Movement { state.setStatus(MovementState.MovementStatus.SUCCESS); return state; } - state.setTarget(new MovementState.MovementTarget(Optional.empty(), Optional.of(Utils.calcRotationFromCoords(playerFeet(), positionsToBreak[1])))).setInput(InputOverrideHandler.Input.MOVE_FORWARD, true); + state.setTarget(new MovementState.MovementTarget(Optional.empty(), Optional.of(Utils.calcRotationFromVec3d(new Vec3d(player().posX, player().posY, player().posZ), Utils.calcCenterFromCoords(positionsToBreak[1], world()))))).setInput(InputOverrideHandler.Input.MOVE_FORWARD, true); return state; default: