ext-chunkutils2 icon indicating copy to clipboard operation
ext-chunkutils2 copied to clipboard

Allow providing ID conversion callbacks to SubChunkConverter

Open dktapps opened this issue 3 years ago • 0 comments

replaceAll() is not suitable for converting between different domains of IDs. This is problematic if we want to alter the subchunks returned by SubChunkConverter (e.g. to expand metadata size), because replaceAll() may replace new values as well as old ones.

This means that we're currently required to construct an entirely new PalettedBlockArray with the remapped palette instead of just altering the original, which wastes performance.

An alternative to this would be to allow providing a conversion callback to SubChunkConverter, but with the current implementation this would cause significant performance degradation, since the ID conversion callback is called for every block.

dktapps avatar Feb 04 '22 23:02 dktapps