fix chunk y rendering

This commit is contained in:
Sen 2025-05-21 14:31:29 +02:00
parent 26c71df542
commit 5e2b36dc82

View file

@ -752,6 +752,7 @@ public class RenderGlobal
double d0 = viewEntity.posX - this.frustumUpdatePosX;
double d1 = viewEntity.posY - this.frustumUpdatePosY;
double d2 = viewEntity.posZ - this.frustumUpdatePosZ;
int prev = this.frustumUpdatePosChunkY;
if (this.frustumUpdatePosChunkX != viewEntity.chunkCoordX || this.frustumUpdatePosChunkY != viewEntity.chunkCoordY || this.frustumUpdatePosChunkZ != viewEntity.chunkCoordZ || d0 * d0 + d1 * d1 + d2 * d2 > 16.0D)
{
@ -904,6 +905,24 @@ public class RenderGlobal
}
this.chunksToUpdate.addAll(set);
if(prev != Integer.MIN_VALUE && viewEntity.chunkCoordY != prev) {
for (int j = -this.renderDistanceChunks; j <= this.renderDistanceChunks; ++j)
{
for (int k = -this.renderDistanceChunks; k <= this.renderDistanceChunks; ++k)
{
for (int i = -this.renderDistanceChunks; i <= this.renderDistanceChunks; ++i)
{
RenderChunk renderchunk1 = this.viewFrustum.getRenderChunk(new BlockPos((j << 4) + 8, (i << 4) + 8, (k << 4) + 8));
if (renderchunk1 != null)
{
renderchunk1.setNeedsUpdate(true);
}
}
}
}
}
}
private boolean isPositionInRenderChunk(BlockPos pos, RenderChunk renderChunkIn)