twoolie / NBT

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

Modify chunk blocks and save #119

Open mariomeissner opened 5 years ago

mariomeissner commented 5 years ago

Hello! I ran into this wonderful codebase today and I believe it suits me well for a project I am working on. I want to load chunks of Minecraft worlds and replace some blocks in it, then save it back to an .mca file for Minecraft to load it.

I've been playing with the code for a few hours now to try to understand how I could achieve this. However I've run into a few problems.

I found a set_block in BlockArray, but it seems like only McRegionChunk is using this, not the new Anvil format. I could not find any equivalent way to set and save blocks in the Anvil classes.

As a last resort I thought that I could directly work with the NBTFile, but I was wondering if there is a cleaner way to do this?