diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 85985c4..23e02fc 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -79,7 +79,7 @@ public class Settings { public final Setting yawSmoothingFactor = new Setting<>(0.2f); - public final Setting pitchSmoothingFactor = new Setting<>(0.22f); + public final Setting pitchSmoothingFactor = new Setting<>(0.2f); public final Setting safeMode = new Setting<>(true); diff --git a/src/main/java/baritone/pathing/movement/movements/MovementFall.java b/src/main/java/baritone/pathing/movement/movements/MovementFall.java index f3ee325..0703b22 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementFall.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementFall.java @@ -62,11 +62,12 @@ public MovementState updateState(MovementState state) { BlockPos playerFeet = ctx.playerFeet(); + Rotation target = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), + VecUtils.getBlockPosCenter(dest), + ctx.playerRotations()).withPitch(ctx.playerRotations().getPitch()); + state.setTarget(new MovementState.MovementTarget( - RotationUtils.calcRotationFromVec3d(ctx.playerHead(), - VecUtils.getBlockPosCenter(dest), - ctx.playerRotations()), - false)); + target, false)); IBlockState destState = ctx.world().getBlockState(dest); Block destBlock = destState.getBlock(); @@ -88,7 +89,7 @@ public MovementState updateState(MovementState state) { state.setInput(Input.SNEAK, true); } - MovementHelper.setInputs(ctx, state, destCenter); + MovementHelper.setInputsAccurate(ctx, state, destCenter); //TODO: Move towards (only keys) dest } Vec3i avoid = Optional.ofNullable(avoid()).map(EnumFacing::getDirectionVec).orElse(null); @@ -97,7 +98,7 @@ public MovementState updateState(MovementState state) { } else { double dist = Math.abs(avoid.getX() * (destCenter.xCoord - avoid.getX() / 2.0 - ctx.playerFeetAsVec().xCoord)) + Math.abs(avoid.getZ() * (destCenter.zCoord - avoid.getZ() / 2.0 - ctx.playerFeetAsVec().zCoord)); if (dist < 0.6) { - MovementHelper.setInputs(ctx, state, destCenter); + MovementHelper.setInputsAccurate(ctx, state, destCenter); //TODO: move towards (only keys) dest } else if (!ctx.player().onGround) { state.setInput(Input.SNEAK, false); @@ -106,7 +107,7 @@ public MovementState updateState(MovementState state) { Vec3 destCenterOffset = new Vec3(destCenter.xCoord + 0.125 * avoid.getX(), destCenter.yCoord - 0.5, destCenter.zCoord + 0.125 * avoid.getZ()); MovementHelper.rotate(ctx, state, src, destCenterOffset); - MovementHelper.setInputs(ctx, state, destCenterOffset); + MovementHelper.setInputsAccurate(ctx, state, destCenterOffset); //TODO: move towards destCenterOffset return state; diff --git a/src/main/java/baritone/pathing/path/PathExecutor.java b/src/main/java/baritone/pathing/path/PathExecutor.java index d2a1082..da8e03f 100644 --- a/src/main/java/baritone/pathing/path/PathExecutor.java +++ b/src/main/java/baritone/pathing/path/PathExecutor.java @@ -14,6 +14,7 @@ import baritone.pathing.movement.CalculationContext; import baritone.pathing.movement.Movement; import baritone.pathing.movement.MovementHelper; +import baritone.pathing.movement.MovementState; import baritone.pathing.movement.movements.*; import net.minecraft.potion.Potion; import net.minecraft.util.BlockPos; @@ -22,6 +23,7 @@ import net.minecraft.util.Vec3i; import java.util.List; +import java.util.Map; import java.util.Optional; import static baritone.api.pathing.movement.MovementStatus.*; @@ -436,8 +438,12 @@ private boolean shouldSprintNextTick() { return true; } clearKeys(); - behavior.baritone.getLookBehavior().updateTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), data.getFirst(), ctx.playerRotations()), false); - behavior.baritone.getInputOverrideHandler().setInputForceState(Input.MOVE_FORWARD, true); + behavior.baritone.getLookBehavior().updateTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), data.getFirst(), ctx.playerRotations()).withPitch(ctx.playerRotations().getPitch()), false); + MovementState state = new MovementState(); + MovementHelper.setInputsAccurate(ctx, state, data.getFirst()); + for (Map.Entry inputState : state.getInputStates().entrySet()) { + behavior.baritone.getInputOverrideHandler().setInputForceState(inputState.getKey(), inputState.getValue()); + } return true; } }