aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-10 08:51:26 +0200
committermakamys <makamys@outlook.com>2021-05-10 08:53:50 +0200
commit43bdf07caffd8e6b269ade5fe9ccaaf741690c16 (patch)
treedbbd7f55bd658d0a3c11197d7ac5818cec78163a /src/main/java/makamys
parentb6c09b36b4db668abf185b77433e15a5a2b28820 (diff)
downloadNeodymium-43bdf07caffd8e6b269ade5fe9ccaaf741690c16.tar.gz
Neodymium-43bdf07caffd8e6b269ade5fe9ccaaf741690c16.tar.bz2
Neodymium-43bdf07caffd8e6b269ade5fe9ccaaf741690c16.zip
Track NBT arrays in ChunkMesh RAM usage
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r--src/main/java/makamys/lodmod/renderer/ChunkMesh.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
index bb93b6e..b6783f6 100644
--- a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java
@@ -79,14 +79,20 @@ public class ChunkMesh extends Mesh {
}
}
} catch(IOException e) {}
- return new NBTTagByteArray(byteOut.toByteArray());
+
+ NBTTagByteArray arr = new NBTTagByteArray(byteOut.toByteArray());
+ usedRAM += arr.func_150292_c().length;
+ return arr;
}
void destroy() {
if(buffer != null) {
usedRAM -= buffer.limit();
- instances--;
}
+ if(nbtData != null) {
+ usedRAM += ((NBTTagByteArray)nbtData).func_150292_c().length;
+ }
+ instances--;
}
@Override