checkworld.py performs a deep scan of a world's files to check for corrupt chunk files. Not only does it check if the file format is correct, it also checks the contents of the chunks (entities, block types) as well. Currently it verifies everything in a chunk except entities (arrows, mobs, etc.), but it does check chests, furnaces, signs, and mob spawners. It currently will not work if you've modified your game to include new block types or new entity types as the tool will check for acceptable block and entity types.
That will check the specified world and write a list of bad chunks to bad_chunks.txt. To regenerate the chunks, delete the files listed in that generated file while your server is offline. The chunks get generated automatically when someone visits the area.
This worked great for me! Just a tip, I seemed to need to launch the command prompt as admin in Windows 7. Also, it saved the bad_chunks.txt file at C:\ (your base directory on the C: drive). Not a problem, because it was easily found with a quick file search. Great job on this script!!! It saved me a TON of work!
diff checkworld.py checkworld.py.org
< or name == 'Squid'\
< if id < 0 or (id >= 93 and id <= 255)\
< or (id >= 355 and id <= 2255)\
> if id < 0 or (id >= 21 and id <= 34)\
> or id == 36\
> or (id >= 92 and id <= 255)\
> or (id >= 351 and id <= 2255)\
< elif id == 'Trap':
< self.expect_child_value(tag, "Items", ListTag, self.expected_valid_chest_items)
< elif id == 'Music':
< self.expect_child_value(tag, "note", ByteTag)
< if block_id < 0 or block_id >= 93:
> if block_id < 0 or (block_id >= 21 and block_id <= 34)\
> or block_id == 36 or block_id >= 92:
ooh that's very handy. Do you mind if I integrate it into my Minecraft Launcher? (An application that backups saves, checks for updates, etc each time you run MC) It's for personal use only so I won't release it or anything, but I thought it'd be nice to ask. :smile.gif:
I just had a problem with a corrupt world causing the server to crash on start up. I ran checkworld.py, as included with MineOS, but it didn't find anything wrong, so I looked to other causes.
Much hair-pulling later, I discover that the root cause of the crash was a corrupt level.dat (it was zero-length). Besides that, several other chunks were zero-length, none of which were detected by this tool. (I found the chunks with c10t, and the level.dat with MCEdit)
Does this tool check for zero-length chunks/files? If not, it really should. I would contribute a patch, but I suck at python.