Skip to content

Commit

Permalink
Fix min y checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Nov 4, 2024
1 parent fd5ca33 commit ee4e445
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private int scanBlock(final ChunkSnapshot chunk, final int imgX, final int imgZ,
final int topY = chunk.getHeight(Heightmap.Types.WORLD_SURFACE, imgX, imgZ) + 1;
mutablePos.set(blockX, Math.min(topY, this.effectiveMaxHeight(chunk)), blockZ);

if (topY > chunk.getMinY() + 1) {
if (topY > chunk.getMinY()) {
state = this.mapWorld.config().MAP_ITERATE_UP
? this.iterateUp(chunk, mutablePos)
: this.iterateDown(chunk, mutablePos);
Expand Down Expand Up @@ -426,6 +426,7 @@ private int getColor(final ChunkSnapshot chunk, final int imgX, final int imgZ,

private BlockState iterateDown(final ChunkSnapshot chunk, final BlockPos.MutableBlockPos mutablePos) {
BlockState state;
// If below the ceiling there is no air, or non-air until minY, render black
if (chunk.dimensionType().hasCeiling()) {
do {
mutablePos.move(Direction.DOWN);
Expand Down

0 comments on commit ee4e445

Please sign in to comment.