player, not center of player feet

This commit is contained in:
Leijurv 2018-08-05 22:00:37 -04:00
parent a35a6409ab
commit 603b33277c
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import baritone.bot.utils.ToolSet;
import baritone.bot.utils.Utils; import baritone.bot.utils.Utils;
import net.minecraft.block.BlockFalling; import net.minecraft.block.BlockFalling;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import java.util.Optional; import java.util.Optional;
@ -78,7 +79,7 @@ public class MovementAscend extends Movement {
return state; 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); state.setInput(InputOverrideHandler.Input.JUMP, true).setInput(InputOverrideHandler.Input.MOVE_FORWARD, true);
return state; return state;
default: default:

View File

@ -14,6 +14,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import java.util.Optional; import java.util.Optional;
@ -97,7 +98,7 @@ public class MovementTraverse extends Movement {
state.setStatus(MovementState.MovementStatus.SUCCESS); state.setStatus(MovementState.MovementStatus.SUCCESS);
return state; 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; return state;
default: default: