Merge pull request #3533 from Echocage/SprintFix
Fix for a sprint bug that can cause death
This commit is contained in:
commit
a73e1185dc
@ -73,8 +73,8 @@ public class PathExecutor implements IPathExecutor, Helper {
|
||||
private HashSet<BlockPos> toPlace = new HashSet<>();
|
||||
private HashSet<BlockPos> toWalkInto = new HashSet<>();
|
||||
|
||||
private PathingBehavior behavior;
|
||||
private IPlayerContext ctx;
|
||||
private final PathingBehavior behavior;
|
||||
private final IPlayerContext ctx;
|
||||
|
||||
private boolean sprintNextTick;
|
||||
|
||||
@ -397,11 +397,20 @@ public class PathExecutor implements IPathExecutor, Helper {
|
||||
return true;
|
||||
}
|
||||
if (canSprintFromDescendInto(ctx, current, next)) {
|
||||
|
||||
if (next instanceof MovementDescend && pathPosition < path.length() - 3) {
|
||||
IMovement next_next = path.movements().get(pathPosition + 2);
|
||||
if (next_next instanceof MovementDescend && !canSprintFromDescendInto(ctx, next, next_next)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
if (ctx.playerFeet().equals(current.getDest())) {
|
||||
pathPosition++;
|
||||
onChangeInPathPosition();
|
||||
onTick();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//logDebug("Turning off sprinting " + movement + " " + next + " " + movement.getDirection() + " " + next.getDirection().down() + " " + next.getDirection().down().equals(movement.getDirection()));
|
||||
|
Loading…
Reference in New Issue
Block a user