Skip to content

Commit

Permalink
Merge pull request #4172 from ZacSharp/1.20.2-update
Browse files Browse the repository at this point in the history
Merge 1.19.4 into 1.20.2
  • Loading branch information
leijurv authored Oct 31, 2023
2 parents 9bf890a + 3a3b012 commit a945cfa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/main/java/baritone/cache/CachedWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ private synchronized void prune() {
int distZ = ((region.getZ() << 9) + 256) - pruneCenter.getZ();
double dist = Math.sqrt(distX * distX + distZ * distZ);
if (dist > 1024) {
if (!Baritone.settings().censorCoordinates.value) {
logDebug("Deleting cached region " + region.getX() + "," + region.getZ() + " from ram");
}
logDebug("Deleting cached region from ram");
cachedRegions.remove(getRegionID(region.getX(), region.getZ()));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/cache/FasterWorldScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private Stream<BlockPos> scanChunkInternal(IPlayerContext ctx, BlockOptionalMeta
long chunkX = (long) pos.x << 4;
long chunkZ = (long) pos.z << 4;

int playerSectionY = ctx.playerFeet().y >> 4;
int playerSectionY = (ctx.playerFeet().y - ctx.world().getMinBuildHeight()) >> 4;

return collectChunkSections(lookup, chunkProvider.getChunk(pos.x, pos.z, false), chunkX, chunkZ, playerSectionY).stream();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/utils/BlockStateInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public BlockState get0(int x, int y, int z) { // Mickey resigned
prevCached = region;
cached = region;
}
BlockState type = cached.getBlock(x & 511, y, z & 511);
BlockState type = cached.getBlock(x & 511, y + world.dimensionType().minY(), z & 511);
if (type == null) {
return AIR;
}
Expand Down

0 comments on commit a945cfa

Please sign in to comment.