Merge branch 'master' into builder
This commit is contained in:
commit
d8348ad292
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
group 'baritone'
|
group 'baritone'
|
||||||
version '1.1.3'
|
version '1.1.4'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -65,6 +65,8 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
|
|
||||||
private boolean lastAutoJump;
|
private boolean lastAutoJump;
|
||||||
|
|
||||||
|
private BlockPos expectedSegmentStart;
|
||||||
|
|
||||||
private final LinkedBlockingQueue<PathEvent> toDispatch = new LinkedBlockingQueue<>();
|
private final LinkedBlockingQueue<PathEvent> toDispatch = new LinkedBlockingQueue<>();
|
||||||
|
|
||||||
public PathingBehavior(Baritone baritone) {
|
public PathingBehavior(Baritone baritone) {
|
||||||
@ -92,6 +94,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
baritone.getPathingControlManager().cancelEverything();
|
baritone.getPathingControlManager().cancelEverything();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
expectedSegmentStart = pathStart();
|
||||||
baritone.getPathingControlManager().preTick();
|
baritone.getPathingControlManager().preTick();
|
||||||
tickPath();
|
tickPath();
|
||||||
dispatchEvents();
|
dispatchEvents();
|
||||||
@ -445,8 +448,12 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
Optional<PathExecutor> executor = calcResult.getPath().map(p -> new PathExecutor(PathingBehavior.this, p));
|
Optional<PathExecutor> executor = calcResult.getPath().map(p -> new PathExecutor(PathingBehavior.this, p));
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
if (executor.isPresent()) {
|
if (executor.isPresent()) {
|
||||||
|
if (executor.get().getPath().getSrc().equals(expectedSegmentStart)) {
|
||||||
queuePathEvent(PathEvent.CALC_FINISHED_NOW_EXECUTING);
|
queuePathEvent(PathEvent.CALC_FINISHED_NOW_EXECUTING);
|
||||||
current = executor.get();
|
current = executor.get();
|
||||||
|
} else {
|
||||||
|
logDebug("Warning: discarding orphan path segment with incorrect start");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (calcResult.getType() != PathCalculationResult.Type.CANCELLATION && calcResult.getType() != PathCalculationResult.Type.EXCEPTION) {
|
if (calcResult.getType() != PathCalculationResult.Type.CANCELLATION && calcResult.getType() != PathCalculationResult.Type.EXCEPTION) {
|
||||||
// don't dispatch CALC_FAILED on cancellation
|
// don't dispatch CALC_FAILED on cancellation
|
||||||
|
@ -25,7 +25,6 @@ import baritone.api.utils.input.Input;
|
|||||||
import baritone.behavior.Behavior;
|
import baritone.behavior.Behavior;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.util.MovementInput;
|
|
||||||
import net.minecraft.util.MovementInputFromOptions;
|
import net.minecraft.util.MovementInputFromOptions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -111,14 +110,17 @@ public final class InputOverrideHandler extends Behavior implements IInputOverri
|
|||||||
}
|
}
|
||||||
blockBreakHelper.tick(isInputForcedDown(Input.CLICK_LEFT));
|
blockBreakHelper.tick(isInputForcedDown(Input.CLICK_LEFT));
|
||||||
|
|
||||||
MovementInput desired = inControl()
|
if (inControl()) {
|
||||||
? new PlayerMovementInput(this)
|
if (ctx.player().movementInput.getClass() != PlayerMovementInput.class) {
|
||||||
: new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
ctx.player().movementInput = new PlayerMovementInput(this);
|
||||||
|
|
||||||
if (ctx.player().movementInput.getClass() != desired.getClass()) {
|
|
||||||
ctx.player().movementInput = desired; // only set it if it was previously incorrect
|
|
||||||
// gotta do it this way, or else it constantly thinks you're beginning a double tap W sprint lol
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (ctx.player().movementInput.getClass() == PlayerMovementInput.class) {
|
||||||
|
ctx.player().movementInput = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// only set it if it was previously incorrect
|
||||||
|
// gotta do it this way, or else it constantly thinks you're beginning a double tap W sprint lol
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean inControl() {
|
private boolean inControl() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user