aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoChunk.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2023-12-02 23:39:05 +0100
committermakamys <makamys@outlook.com>2023-12-03 00:48:50 +0100
commit78aef66f5e122d7fca9cc6057180147fde7993e5 (patch)
tree76ad2014035cb2120b54ba7c31c42781f006511e /src/main/java/makamys/neodymium/renderer/NeoChunk.java
parent2f4979260b60f90ef0fce1b9305b74bcd9fb8af5 (diff)
downloadNeodymium-78aef66f5e122d7fca9cc6057180147fde7993e5.tar.gz
Neodymium-78aef66f5e122d7fca9cc6057180147fde7993e5.tar.bz2
Neodymium-78aef66f5e122d7fca9cc6057180147fde7993e5.zip
Fix NeoRegions not getting deallocated
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoChunk.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoChunk.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoChunk.java b/src/main/java/makamys/neodymium/renderer/NeoChunk.java
index 92b5c86..de4746c 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoChunk.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoChunk.java
@@ -43,11 +43,14 @@ public class NeoChunk {
if(chunkMeshes[cy * 2 + i] != null) {
renderer.removeMesh(chunkMeshes[cy * 2 + i]);
chunkMeshes[cy * 2 + i].destroy();
- } else {
+ region.meshes--;
+ dirty = true;
+ }
+ if(newChunkMesh != null){
region.meshes++;
+ dirty = true;
}
chunkMeshes[cy * 2 + i] = newChunkMesh;
- dirty = true;
}
}
if(dirty) {