diff options
author | makamys <makamys@outlook.com> | 2021-05-10 08:51:26 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-10 08:53:50 +0200 |
commit | 43bdf07caffd8e6b269ade5fe9ccaaf741690c16 (patch) | |
tree | dbbd7f55bd658d0a3c11197d7ac5818cec78163a /src/main/java/makamys | |
parent | b6c09b36b4db668abf185b77433e15a5a2b28820 (diff) | |
download | Neodymium-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.java | 10 |
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 |