When using the ChunkPager it happened once that a Chunk was evicted from the ChunkCache while the ChunkManager was still generating the mesh.
This resulted in a NPE in the Chunk class:
public Block getBlock(int x, int y, int z) {
if (isInsideChunk(x, y, z)) {
return this.blocks[calculateIndex(x, y, z)];
}
...
the this.blocks variable is null when the chunk is cleaned up.
This doesn't break the functionality since the ChunkPager decided that the chunk should not be rendered (hence the evict). But there is probably a better way to handle this behaviour. All tasks for chunks that are discarded should be aborted.
When using the ChunkPager it happened once that a Chunk was evicted from the ChunkCache while the ChunkManager was still generating the mesh.
This resulted in a NPE in the Chunk class:
the
this.blocks
variable isnull
when the chunk is cleaned up.This doesn't break the functionality since the ChunkPager decided that the chunk should not be rendered (hence the evict). But there is probably a better way to handle this behaviour. All tasks for chunks that are discarded should be aborted.