NBT
NBT copied to clipboard
Selective/partial chunk loading
Some applications, like mappers, benefit from caching chunks and regions locally. However, a fully loaded region can take up significant space in memory, which limits the usefulness of caches.
I'm proposing a mechanism for loading only the portions of a chunk or region that an application intends to use. Then, the internal reference to data
in the chunks could be released to allow it to be garbage collected.
I propose something like this:
MCAFile::public void deserialize(RandomAccessFile raf, int fieldFlags) throws IOException
It would be used like this:
mca.deserialize(file, BLOCK_IDS|HEIGHTMAPS|BLOCKLIGHT);
A chunk loaded this way cannot be written to disk and any attempt to do so should throw an exception.
If this seems OK, I will prepare a PR with the changes.