diagonal descend option

This commit is contained in:
Leijurv 2018-12-20 21:06:56 -08:00
parent ae9ab03e51
commit 8a4f48f08d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 17 additions and 4 deletions

View File

@ -111,6 +111,15 @@ public class Settings {
*/
public Setting<Boolean> allowJumpAt256 = new Setting<>(false);
/**
* Allow descending diagonally
* <p>
* Safer than allowParkour yet still slightly unsafe, can make contact with unchecked adjacent blocks, so it's unsafe in the nether.
* <p>
* For a generic "take some risks" mode I'd turn on this one, parkour, and parkour place.
*/
public Setting<Boolean> allowDiagonalDescend = new Setting<>(false);
/**
* Blocks that Baritone is allowed to place (as throwaway, for sneak bridging, pillaring, etc.)
*/
@ -163,10 +172,8 @@ public class Settings {
* metric gets better and better with each block, instead of slightly worse.
* <p>
* Finding the optimal path is worth it, so it's the default.
* <p>
* This value is an expression instead of a literal so that it's exactly equal to SPRINT_ONE_BLOCK_COST defined in ActionCosts.java
*/
public Setting<Double> costHeuristic = new Setting<>(20 / 5.612);
public Setting<Double> costHeuristic = new Setting<>(3.563);
// a bunch of obscure internal A* settings that you probably don't want to change
/**

View File

@ -57,6 +57,7 @@ public class CalculationContext {
private final boolean allowParkourPlace;
private final boolean allowJumpAt256;
private final boolean assumeWalkOnWater;
private final boolean allowDiagonalDescend;
private final int maxFallHeightNoWater;
private final int maxFallHeightBucket;
private final double waterWalkSpeed;
@ -86,6 +87,7 @@ public class CalculationContext {
this.allowParkourPlace = Baritone.settings().allowParkourPlace.get();
this.allowJumpAt256 = Baritone.settings().allowJumpAt256.get();
this.assumeWalkOnWater = Baritone.settings().assumeWalkOnWater.get();
this.allowDiagonalDescend = Baritone.settings().allowDiagonalDescend.get();
this.maxFallHeightNoWater = Baritone.settings().maxFallHeightNoWater.get();
this.maxFallHeightBucket = Baritone.settings().maxFallHeightBucket.get();
int depth = EnchantmentHelper.getDepthStriderModifier(player);
@ -201,6 +203,10 @@ public class CalculationContext {
return assumeWalkOnWater;
}
public boolean allowDiagonalDescend() {
return allowDiagonalDescend;
}
public int maxFallHeightNoWater() {
return maxFallHeightNoWater;
}

View File

@ -72,7 +72,7 @@ public class MovementDiagonal extends Movement {
boolean descend = false;
if (!MovementHelper.canWalkOn(context.bsi(), destX, y - 1, destZ, destWalkOn)) {
descend = true;
if (!MovementHelper.canWalkOn(context.bsi(), destX, y - 2, destZ) || !MovementHelper.canWalkThrough(context.bsi(), destX, y - 1, destZ, destWalkOn)) {
if (!context.allowDiagonalDescend() || !MovementHelper.canWalkOn(context.bsi(), destX, y - 2, destZ) || !MovementHelper.canWalkThrough(context.bsi(), destX, y - 1, destZ, destWalkOn)) {
return;
}
}