A level definition?
As for the region thing, 1 region is already too large to fit in the memory of two programs at once, it seems! 500 is only a tad smaller than 512.
Only if you actually define every single block. Interesting info: Minecraft subdivides its chunk NBT format into sixteen 16x16x16 "sections", of which only those that aren't all air need to be defined. My program generates these sections on demand, and stores them in native arrays in memory, so it uses up only 4kb per section you touch.
MagmaMcFry: Here's the next error!
updated gist
java.lang.ClassCastException: org.json.JSONObject$Null cannot be cast
ng.Integer
at mcfry.MCJsonDimension.create(MCJsonDimension.java:27)
at mcfry.MCJsonWorld.create(MCJsonWorld.java:17)
at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:23)
I assume you still have the spheregen.py-generated files.
This happens because None values in your Python array would convert to Java nulls, which would complain when you converted them to integers.
Anyway,
I did stuff to fix the memory issues.I rewrote the JSON format again, and now you can basically send commands to the worldgen thing by writing JSON objects to STDOUT. There are three types of commands: Block commands which let you define a cuboid of blocks and a rectangle of biomes anywhere in any dimension (by specifying an initial (X, Y, Z) offset), level commands which generate a level.dat, and region export commands which tell Java to export a specific region to a region file and clear it from memory. This means that your Python program only ever needs to hold in memory the contents of a single sphere, which it can completely flush to Java before rendering the next sphere. And don't worry about holding several regions in Java's memory at once: I've estimated a region to take up at most 100MB of space in that memory, and that will only happen if you touch every single chunk section of that region (which you definitely won't by a large margin), but try to export those regions that you're sure you won't touch again.
To avoid overwriting spheres with the blank space caused by the cube of air around later spheres, you can now use the block IDs of None or -1 to denote 'don't overwrite this block please'.
Also note that you may not have any characters or spaces or newlines between adjacent JSON commands in the pipe.
Oh, and for any other programmers in this thread: Obviously you don't need to send commands using Python; any language will do (as long as you have some sort of JSON library available).