New version out!Would that be
python myScript.py | java yourProgram ?
You can use either of these:
python yourScript.py | java mcfry.JsonWorldGenerator
python yourScript.py | convertFromSTDIN.bat
They should be identical in functionality, since convertFromSTDIN.sh contains "java mcfry.JsonWorldGenerator".
Also, that sounds much better than the temporary file method, though I wonder how you can tell that the input stream is finished...
I can tell that it's finished when a) it closes or b) the main JSON map's closing brace appears.
edit2: I know you've already done a lot for me (even the current version of MCJSON is awesome), but I was wondering if you could whip up a similar library for the level.dat, which iirc is where player spawn is defined...? Wouldn't want to spawn the player over open air with no materials to climb to a planet I mean, level.dat is probably simpler in format (if I'm lucky, it won't even be a NBT file), but .. yeah
Actually, level.dat is an NBT file, but that makes it easier for me. I changed the world.txt file format, it can now define multiple dimensions, as well as a level.dat file! Note that all the level.dat parameters are optional, they default to values identical to vanilla survival's values.
edit3: Any idea what "decorate" : false does? Doesn't seem to be in the wiki's documentation.
The world generator works in two steps. First, the terrain is generated, using only dirt and stone and sand and water and bedrock. Second, all the things like trees and flowers and ores and lakes and villages and caves and mineshafts are generated inside that terrain. To ensure smooth chunk-to-chunk transitions, a chunk is only decorated when all its neighboring chunks are already generated and loaded (so trees and stuff can spill over onto neighboring chunks without being cut off), which means that the chunk needs to have a flag saying whether it's already decorated or not. This flag is saved in the region files, so if I set that flag to "not decorated yet" when writing a custom chunk to NBT, Minecraft will go and decorate that chunk itself when it loads the chunk. But if I set the flag to "decorated already", then Minecraft won't do anything with the new chunk, leaving all your blocks intact.