sprinting
This commit is contained in:
@@ -18,11 +18,13 @@
|
|||||||
package baritone.bot.pathing.movement;
|
package baritone.bot.pathing.movement;
|
||||||
|
|
||||||
import baritone.bot.Baritone;
|
import baritone.bot.Baritone;
|
||||||
import baritone.bot.InputOverrideHandler;
|
|
||||||
import baritone.bot.behavior.impl.LookBehavior;
|
import baritone.bot.behavior.impl.LookBehavior;
|
||||||
import baritone.bot.behavior.impl.LookBehaviorUtils;
|
import baritone.bot.behavior.impl.LookBehaviorUtils;
|
||||||
import baritone.bot.pathing.movement.MovementState.MovementStatus;
|
import baritone.bot.pathing.movement.MovementState.MovementStatus;
|
||||||
import baritone.bot.utils.*;
|
import baritone.bot.utils.BlockStateInterface;
|
||||||
|
import baritone.bot.utils.Helper;
|
||||||
|
import baritone.bot.utils.Rotation;
|
||||||
|
import baritone.bot.utils.ToolSet;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
@@ -85,6 +87,7 @@ public abstract class Movement implements Helper, MovementHelper {
|
|||||||
* @return Status
|
* @return Status
|
||||||
*/
|
*/
|
||||||
public MovementStatus update() {
|
public MovementStatus update() {
|
||||||
|
player().setSprinting(false);
|
||||||
MovementState latestState = updateState(currentState);
|
MovementState latestState = updateState(currentState);
|
||||||
if (BlockStateInterface.isLiquid(playerFeet())) {
|
if (BlockStateInterface.isLiquid(playerFeet())) {
|
||||||
latestState.setInput(Input.JUMP, true);
|
latestState.setInput(Input.JUMP, true);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class MovementAscend extends Movement {
|
|||||||
private BlockPos[] against = new BlockPos[3];
|
private BlockPos[] against = new BlockPos[3];
|
||||||
|
|
||||||
public MovementAscend(BlockPos src, BlockPos dest) {
|
public MovementAscend(BlockPos src, BlockPos dest) {
|
||||||
super(src, dest, new BlockPos[] { dest, src.up(2), dest.up() }, new BlockPos[] { dest.down() });
|
super(src, dest, new BlockPos[]{dest, src.up(2), dest.up()}, new BlockPos[]{dest.down()});
|
||||||
|
|
||||||
BlockPos placementLocation = positionsToPlace[0]; // dest.down()
|
BlockPos placementLocation = positionsToPlace[0]; // dest.down()
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -79,7 +79,6 @@ public class MovementAscend extends Movement {
|
|||||||
@Override
|
@Override
|
||||||
public MovementState updateState(MovementState state) {
|
public MovementState updateState(MovementState state) {
|
||||||
super.updateState(state);
|
super.updateState(state);
|
||||||
System.out.println("Ticking with state " + state.getStatus());
|
|
||||||
// TODO incorporate some behavior from ActionClimb (specifically how it waited until it was at most 1.2 blocks away before starting to jump
|
// TODO incorporate some behavior from ActionClimb (specifically how it waited until it was at most 1.2 blocks away before starting to jump
|
||||||
// for efficiency in ascending minimal height staircases, which is just repeated MovementAscend, so that it doesn't bonk its head on the ceiling repeatedly)
|
// for efficiency in ascending minimal height staircases, which is just repeated MovementAscend, so that it doesn't bonk its head on the ceiling repeatedly)
|
||||||
switch (state.getStatus()) {
|
switch (state.getStatus()) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class MovementDiagonal extends Movement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MovementDiagonal(BlockPos start, BlockPos end, BlockPos dir1, BlockPos dir2) {
|
public MovementDiagonal(BlockPos start, BlockPos end, BlockPos dir1, BlockPos dir2) {
|
||||||
super(start, end, new BlockPos[] { dir1, dir1.up(), dir2, dir2.up(), end, end.up() }, new BlockPos[] { end.down() });
|
super(start, end, new BlockPos[]{dir1, dir1.up(), dir2, dir2.up(), end, end.up()}, new BlockPos[]{end.down()});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,6 +58,9 @@ public class MovementDiagonal extends Movement {
|
|||||||
state.setStatus(MovementState.MovementStatus.SUCCESS);
|
state.setStatus(MovementState.MovementStatus.SUCCESS);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
if (!BlockStateInterface.isLiquid(playerFeet())) {
|
||||||
|
player().setSprinting(true);
|
||||||
|
}
|
||||||
MovementHelper.moveTowards(state, dest);
|
MovementHelper.moveTowards(state, dest);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ public class MovementTraverse extends Movement {
|
|||||||
state.setStatus(MovementState.MovementStatus.SUCCESS);
|
state.setStatus(MovementState.MovementStatus.SUCCESS);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
if (wasTheBridgeBlockAlwaysThere) {
|
if (wasTheBridgeBlockAlwaysThere && !BlockStateInterface.isLiquid(playerFeet())) {
|
||||||
// player().setSprinting(true);
|
player().setSprinting(true);
|
||||||
}
|
}
|
||||||
MovementHelper.moveTowards(state, positionsToBreak[0]);
|
MovementHelper.moveTowards(state, positionsToBreak[0]);
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@@ -88,7 +88,9 @@ public class PathExecutor extends Behavior {
|
|||||||
}
|
}
|
||||||
for (int i = pathPosition + 2; i < path.length(); i++) { //dont check pathPosition+1. the movement tells us when it's done (e.g. sneak placing)
|
for (int i = pathPosition + 2; i < path.length(); i++) { //dont check pathPosition+1. the movement tells us when it's done (e.g. sneak placing)
|
||||||
if (whereAmI.equals(path.positions().get(i))) {
|
if (whereAmI.equals(path.positions().get(i))) {
|
||||||
displayChatMessageRaw("Skipping forward " + (i - pathPosition) + " steps, to " + i);
|
if (i - pathPosition > 2) {
|
||||||
|
displayChatMessageRaw("Skipping forward " + (i - pathPosition) + " steps, to " + i);
|
||||||
|
}
|
||||||
pathPosition = i - 1;
|
pathPosition = i - 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user