From 6ae957fce32afec5abfcf1903a4db15c6e59c1cb Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 8 May 2021 23:35:20 +0200 Subject: No more flickers --- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/makamys/lodmod/renderer') diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 28b146d..af05dc6 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -369,7 +369,9 @@ public class LODRenderer { public void onWorldRendererRender(WorldRenderer wr) { LODChunk lodChunk = getLODChunk(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16)); - setVisible(lodChunk, false); + int y = Math.floorDiv(wr.posY, 16); + setMeshVisible(lodChunk.chunkMeshes[y * 2 + 0], false); + setMeshVisible(lodChunk.chunkMeshes[y * 2 + 1], false); } public void onDontDraw(WorldRenderer wr) { @@ -380,7 +382,9 @@ public class LODRenderer { Entity player = (Entity)Minecraft.getMinecraft().getIntegratedServer().getConfigurationManager().playerEntityList.get(0); LODChunk lodChunk = getLODChunk(chunkX, chunkZ); - setVisible(lodChunk, true); + int y = Math.floorDiv(wr.posY, 16); + setMeshVisible(lodChunk.chunkMeshes[y * 2 + 0], true); + setMeshVisible(lodChunk.chunkMeshes[y * 2 + 1], true); } private double getLastSortDistanceSq(Entity player) { -- cgit