twoolie/NBT — pull request #33 by macfreek (2012-03-15 22:02:38+00:00)
Title: World examples

**Warning: this pull request contains a minor non-backware compatible change to world.WorldFolder.** This is only an issue if a world is created when a tool is specifically requesting a McRegion or Anvil WorldFolder:

wf = nbt.world.Worldfolder(world_folder, nbt.world.Format.MCREGION)

becomes

wf = nbt.world.McRegionWorldfolder(world_folder)

If you just want the latest world-folder format, the API remains unchanged:

wf = nbt.world.Worldfolder(world_folder)

This is so minor (since WorldFolder was only introduced 2 weeks ago) that I do not consider it an issue and have not increased the version number.

This pull request is **branched after pull request #32**; please examine that request first. (_The comment below are only about commits 113d0c2c to 919e9eb0_. Let me know if this is problem and you want me to rebase this.)

### Changes to world.py:

* Add iter_nbt() function. This is slightly faster than iter_chuncks().
* WorldFolder() is now subclassed for Anvil&McRegion. This makes it more flexible.
* get_chunk() raises LookupError for non-existing Chunks.

### Changes to examples:

* Add example for analysis of the different biomes in Anvil
* Minor bug fixes features in (documentation of) examples
* Minor usability change in map: aborting now writes a partial map file, but does not show it.