Merge branch '1.21.3' into 1.21.4
This commit is contained in:
@@ -185,6 +185,13 @@ public final class Settings {
|
||||
* <p>
|
||||
* Defaults to false because this fails on constantiam. Please let me know if this is ever disabled. Please.
|
||||
*/
|
||||
public final Setting<Boolean> allowJumpAtBuildLimit = new Setting<>(false);
|
||||
|
||||
/**
|
||||
* Just here so mods that use the API don't break. Does nothing.
|
||||
*/
|
||||
@Deprecated
|
||||
@JavaOnly
|
||||
public final Setting<Boolean> allowJumpAt256 = new Setting<>(false);
|
||||
|
||||
/**
|
||||
|
||||
@@ -84,6 +84,10 @@ public class SettingsUtil {
|
||||
|
||||
String settingName = matcher.group("setting").toLowerCase();
|
||||
String settingValue = matcher.group("value");
|
||||
// TODO remove soonish
|
||||
if ("allowjumpat256".equals(settingName)) {
|
||||
settingName = "allowjumpatbuildlimit";
|
||||
}
|
||||
try {
|
||||
parseAndApply(settings, settingName, settingValue);
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -40,10 +40,10 @@ public class RenderCommand extends Command {
|
||||
int renderDistance = (ctx.minecraft().options.renderDistance().get() + 1) * 16;
|
||||
ctx.minecraft().levelRenderer.setBlocksDirty(
|
||||
origin.x - renderDistance,
|
||||
0,
|
||||
ctx.world().getMinY(),
|
||||
origin.z - renderDistance,
|
||||
origin.x + renderDistance,
|
||||
255,
|
||||
ctx.world().getMaxY(),
|
||||
origin.z + renderDistance
|
||||
);
|
||||
logDirect("Done");
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TunnelCommand extends Command {
|
||||
int width = Integer.parseInt(args.getArgs().get(1).getValue());
|
||||
int depth = Integer.parseInt(args.getArgs().get(2).getValue());
|
||||
|
||||
if (width < 1 || height < 2 || depth < 1 || height > 255) {
|
||||
if (width < 1 || height < 2 || depth < 1 || height > ctx.world().getMaxY()){
|
||||
logDirect("Width and depth must at least be 1 block; Height must at least be 2 blocks, and cannot be greater than the build limit.");
|
||||
cont = false;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class CalculationContext {
|
||||
public final List<Block> allowBreakAnyway;
|
||||
public final boolean allowParkour;
|
||||
public final boolean allowParkourPlace;
|
||||
public final boolean allowJumpAt256;
|
||||
public final boolean allowJumpAtBuildLimit;
|
||||
public final boolean allowParkourAscend;
|
||||
public final boolean assumeWalkOnWater;
|
||||
public boolean allowFallIntoLava;
|
||||
@@ -107,7 +107,7 @@ public class CalculationContext {
|
||||
this.allowBreakAnyway = new ArrayList<>(Baritone.settings().allowBreakAnyway.value);
|
||||
this.allowParkour = Baritone.settings().allowParkour.value;
|
||||
this.allowParkourPlace = Baritone.settings().allowParkourPlace.value;
|
||||
this.allowJumpAt256 = Baritone.settings().allowJumpAt256.value;
|
||||
this.allowJumpAtBuildLimit = Baritone.settings().allowJumpAtBuildLimit.value;
|
||||
this.allowParkourAscend = Baritone.settings().allowParkourAscend.value;
|
||||
this.assumeWalkOnWater = Baritone.settings().assumeWalkOnWater.value;
|
||||
this.allowFallIntoLava = false; // Super secret internal setting for ElytraBehavior
|
||||
|
||||
@@ -147,9 +147,9 @@ public class MovementDescend extends Movement {
|
||||
int effectiveStartHeight = y;
|
||||
for (int fallHeight = 3; true; fallHeight++) {
|
||||
int newY = y - fallHeight;
|
||||
if (newY < 0) {
|
||||
if (newY < context.world.getMinY()) {
|
||||
// when pathing in the end, where you could plausibly fall into the void
|
||||
// this check prevents it from getting the block at y=-1 and crashing
|
||||
// this check prevents it from getting the block at y=(below whatever the minimum height is) and crashing
|
||||
return false;
|
||||
}
|
||||
boolean reachedMinimum = fallHeight >= context.minFallHeight;
|
||||
|
||||
@@ -64,10 +64,9 @@ public class MovementParkour extends Movement {
|
||||
if (!context.allowParkour) {
|
||||
return;
|
||||
}
|
||||
if (y == 256 && !context.allowJumpAt256) {
|
||||
if (!context.allowJumpAtBuildLimit && y >= context.world.getMaxY()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int xDiff = dir.getStepX();
|
||||
int zDiff = dir.getStepZ();
|
||||
if (!MovementHelper.fullyPassable(context, x + xDiff, y, z + zDiff)) {
|
||||
|
||||
@@ -56,12 +56,12 @@ public final class BlockStateInterfaceAccessWrapper implements BlockGetter {
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return 255;
|
||||
return bsi.world.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinY() {
|
||||
return 0;
|
||||
return bsi.world.getMinY();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user