diff options
author | makamys <makamys@outlook.com> | 2021-05-10 13:05:47 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-10 13:05:47 +0200 |
commit | b083ec25e114fd7616c14a90253a1fae835e0735 (patch) | |
tree | 3967c8a8be0b72c01520de1a97928faa528fb10e /src/main/java/makamys/lodmod/renderer/LODRenderer.java | |
parent | 869a8d464ce6610db56ffe7cf73a1367d87a9e10 (diff) | |
download | Neodymium-b083ec25e114fd7616c14a90253a1fae835e0735.tar.gz Neodymium-b083ec25e114fd7616c14a90253a1fae835e0735.tar.bz2 Neodymium-b083ec25e114fd7616c14a90253a1fae835e0735.zip |
A little refactor in LODRenderer#onWorldRendererRender
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 9fdaa06..891f736 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -415,8 +415,12 @@ public class LODRenderer { } public void onWorldRendererRender(WorldRenderer wr) { - LODChunk lodChunk = getLODChunk(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16)); + int x = Math.floorDiv(wr.posX, 16); int y = Math.floorDiv(wr.posY, 16); + int z = Math.floorDiv(wr.posZ, 16); + + LODChunk lodChunk = getLODChunk(x, z); + setMeshVisible(lodChunk.chunkMeshes[y * 2 + 0], false); setMeshVisible(lodChunk.chunkMeshes[y * 2 + 1], false); setMeshVisible(lodChunk.simpleMeshes[0], false); |