twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
362 stars 74 forks source link

Possibly adding non-free blocks to free_sectors when dealing with overlapping chunks #123

Open s-leroux opened 5 years ago

s-leroux commented 5 years ago

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#L679

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.