Keep original player movement.

This commit is contained in:
Murat65536
2025-07-06 20:25:02 -04:00
parent a30e3ce8e3
commit 191155315b
2 changed files with 9 additions and 23 deletions

View File

@@ -661,17 +661,6 @@ public interface MovementHelper extends ActionCosts, Helper {
static void moveTowardsWithRotation(IPlayerContext ctx, MovementState state, BlockPos dest, Rotation rotation) { static void moveTowardsWithRotation(IPlayerContext ctx, MovementState state, BlockPos dest, Rotation rotation) {
state.setTarget(new MovementTarget(rotation, true)); state.setTarget(new MovementTarget(rotation, true));
/*
Options:
W: ax, az
S: -ax,-az
A: -az,ax
D: az,-ax
W+A:ax-az,az+ax,
W+D:ax+az,az-ax,
S+A:-ax-az,-az+ax,
S+D:-ax+az,-az-ax
*/
boolean canSprint = Baritone.settings().allowSprint.value; boolean canSprint = Baritone.settings().allowSprint.value;
float ax = Mth.sin((float)Math.toRadians(ctx.playerRotations().getYaw())); float ax = Mth.sin((float)Math.toRadians(ctx.playerRotations().getYaw()));
float az = Mth.cos((float)Math.toRadians(ctx.playerRotations().getYaw())); float az = Mth.cos((float)Math.toRadians(ctx.playerRotations().getYaw()));
@@ -681,14 +670,14 @@ public interface MovementHelper extends ActionCosts, Helper {
float targetAx = Mth.sin((float)Math.toRadians(blockRotation.getYaw())); float targetAx = Mth.sin((float)Math.toRadians(blockRotation.getYaw()));
float targetAz = Mth.cos((float)Math.toRadians(blockRotation.getYaw())); float targetAz = Mth.cos((float)Math.toRadians(blockRotation.getYaw()));
float[][] options = { float[][] options = {
{canSprint ? ax * 1.3f : ax, canSprint ? az * 1.3f : az}, {canSprint ? ax * 1.3f : ax, canSprint ? az * 1.3f : az}, // W
{-ax, -az}, {-ax, -az}, // S
{-az, az}, {-az, az}, // A
{az, -ax}, {az, -ax}, // D
{(canSprint ? ax * 1.3f : ax) - az, (canSprint ? az * 1.3f : az) + ax}, {(canSprint ? ax * 1.3f : ax) - az, (canSprint ? az * 1.3f : az) + ax}, // W+A
{(canSprint ? ax * 1.3f : ax) + az, (canSprint ? az * 1.3f : az) - ax}, {(canSprint ? ax * 1.3f : ax) + az, (canSprint ? az * 1.3f : az) - ax}, // W+D
{-ax - az, -az + ax}, {-ax - az, -az + ax}, // S+A
{-ax + az, -az - ax} {-ax + az, -az - ax} // S+D
}; };
int selection = -1; int selection = -1;
float closestX = 100000; float closestX = 100000;

View File

@@ -352,10 +352,7 @@ public class MovementTraverse extends Movement {
} }
return state; return state;
} }
MovementHelper.moveTowardsWithRotation(ctx, state, dest, MovementHelper.moveTowardsWithRotation(ctx, state, dest, ctx.playerRotations());
RotationUtils.calcRotationFromVec3d(ctx.playerHead(),
VecUtils.getBlockPosCenter(dest),
ctx.playerRotations()).add(new Rotation(45, 0).withPitch(ctx.playerRotations().getPitch())));
return state; return state;
// TODO MovementManager.moveTowardsBlock(to); // move towards not look at because if we are bridging for a couple blocks in a row, it is faster if we dont spin around and walk forwards then spin around and place backwards for every block // TODO MovementManager.moveTowardsBlock(to); // move towards not look at because if we are bridging for a couple blocks in a row, it is faster if we dont spin around and walk forwards then spin around and place backwards for every block
} }