Merge branch '1.20.4' into 1.20.6

This commit is contained in:
ZacSharp
2025-05-13 13:46:05 +02:00
8 changed files with 21 additions and 11 deletions

View File

@@ -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);
/**

View File

@@ -83,6 +83,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) {

View File

@@ -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().getMinBuildHeight(),
origin.z - renderDistance,
origin.x + renderDistance,
255,
ctx.world().getMaxBuildHeight(),
origin.z + renderDistance
);
logDirect("Done");

View File

@@ -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().getMaxBuildHeight()){
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;
}

View File

@@ -63,7 +63,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;
@@ -104,7 +104,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

View File

@@ -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.getMinBuildHeight()) {
// 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;

View File

@@ -64,10 +64,9 @@ public class MovementParkour extends Movement {
if (!context.allowParkour) {
return;
}
if (y == 256 && !context.allowJumpAt256) {
if (!context.allowJumpAtBuildLimit && y >= context.world.getMaxBuildHeight()) {
return;
}
int xDiff = dir.getStepX();
int zDiff = dir.getStepZ();
if (!MovementHelper.fullyPassable(context, x + xDiff, y, z + zDiff)) {

View File

@@ -56,12 +56,12 @@ public final class BlockStateInterfaceAccessWrapper implements BlockGetter {
@Override
public int getHeight() {
return 255;
return bsi.world.getHeight();
}
@Override
public int getMinBuildHeight() {
return 0;
return bsi.world.getMinBuildHeight();
}
}