However, if you are dealing with a chunk having the status STATUS_CHUNK_OVERLAPPING, by definition (some of) those blocks are shared with another chunk. So I think in that particular case, the previously allocated blocks shouldn't be added to the free_sectors list.
In my understanding, when you call
write_blockdata
to replace a chunk in a region file, the blocks previously allocated to that chunk are freed by https://github.com/twoolie/NBT/blob/master/nbt/region.py#L679However, if you are dealing with a chunk having the status STATUS_CHUNK_OVERLAPPING, by definition (some of) those blocks are shared with another chunk. So I think in that particular case, the previously allocated blocks shouldn't be added to the
free_sectors
list.