Keep original player movement.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user