diff options
author | makamys <makamys@outlook.com> | 2021-05-08 02:52:02 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-08 02:52:02 +0200 |
commit | 59f7e189fa351901ac94142176b7854686163e1a (patch) | |
tree | 8fcfe23ac768de58344c8b302b95a5600e442153 /src/main/java/makamys | |
parent | d80373ad654a1f2d580a96e5e433712eaf045946 (diff) | |
download | Neodymium-59f7e189fa351901ac94142176b7854686163e1a.tar.gz Neodymium-59f7e189fa351901ac94142176b7854686163e1a.tar.bz2 Neodymium-59f7e189fa351901ac94142176b7854686163e1a.zip |
Fix simple meshes not getting unloaded when they're replaced
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODChunk.java | 7 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODChunk.java b/src/main/java/makamys/lodmod/renderer/LODChunk.java index cdf04b7..63b43e7 100644 --- a/src/main/java/makamys/lodmod/renderer/LODChunk.java +++ b/src/main/java/makamys/lodmod/renderer/LODChunk.java @@ -66,6 +66,13 @@ public class LODChunk { } } + public void putSimpleMesh(SimpleChunkMesh mesh) { + if(simpleMesh != null) { + renderer.setMeshVisible(simpleMesh, false); + } + simpleMesh = mesh; + } + public boolean hasChunkMeshes() { for(ChunkMesh cm : chunkMeshes) { if(cm != null) { diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index f40c977..76882ad 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -443,7 +443,7 @@ public class LODRenderer { } private void sendChunkToGPU(LODChunk lodChunk) { - lodChunk.simpleMesh = new SimpleChunkMesh(lodChunk.chunk); + lodChunk.putSimpleMesh(new SimpleChunkMesh(lodChunk.chunk)); Entity player = (Entity) Minecraft.getMinecraft().getIntegratedServer().getConfigurationManager().playerEntityList.get(0); |