fix parkour failures at height limit on NCP

This commit is contained in:
Leijurv 2018-12-12 18:14:56 -08:00
parent 44963fa4c7
commit 801727dca6
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 16 additions and 0 deletions

View File

@ -94,6 +94,13 @@ public class Settings {
*/
public Setting<Boolean> assumeSafeWalk = new Setting<>(false);
/**
* If true, parkour is allowed to make jumps when standing on blocks at the maximum height, so player feet is y=256
* <p>
* Defaults to false because this fails on NCP
*/
public Setting<Boolean> allowJumpAt256 = new Setting<>(false);
/**
* Blocks that Baritone is allowed to place (as throwaway, for sneak bridging, pillaring, etc.)
*/

View File

@ -55,6 +55,7 @@ public class CalculationContext {
private final boolean allowBreak;
private final boolean allowParkour;
private final boolean allowParkourPlace;
private final boolean allowJumpAt256;
private final boolean assumeWalkOnWater;
private final int maxFallHeightNoWater;
private final int maxFallHeightBucket;
@ -81,6 +82,7 @@ public class CalculationContext {
this.allowBreak = Baritone.settings().allowBreak.get();
this.allowParkour = Baritone.settings().allowParkour.get();
this.allowParkourPlace = Baritone.settings().allowParkourPlace.get();
this.allowJumpAt256 = Baritone.settings().allowJumpAt256.get();
this.assumeWalkOnWater = Baritone.settings().assumeWalkOnWater.get();
this.maxFallHeightNoWater = Baritone.settings().maxFallHeightNoWater.get();
this.maxFallHeightBucket = Baritone.settings().maxFallHeightBucket.get();
@ -187,6 +189,10 @@ public class CalculationContext {
return allowParkourPlace;
}
public boolean allowJumpAt256() {
return allowJumpAt256;
}
public boolean assumeWalkOnWater() {
return assumeWalkOnWater;
}

View File

@ -63,6 +63,9 @@ public class MovementParkour extends Movement {
if (!context.allowParkour()) {
return;
}
if (y == 256 && !context.allowJumpAt256()) {
return;
}
int xDiff = dir.getXOffset();
int zDiff = dir.getZOffset();