1 I'll try to quickly document the newest block format in here (might contain
2 errors). Refer to the mapgen or minetestmapper script for the directory
3 structure and file naming. There are two sector namings possible,
4 sector/XXXXZZZZ and sector/XXX/ZZZ.
6 There also exists files map_meta.txt and chunk_meta, that are used by the
7 generator. If they are not found or invalid, the generator will currently
8 behave quite strangely.
10 The MapBlock file format (sectors2/XXX/ZZZ/YYYY):
12 NOTE: Byte order is MSB first.
15 - map format version number, this one is version 17
19 - 0x01: is_underground: Should be set to 0 if there will be no light
20 obstructions above the block. If/when sunlight of a block is updated and
21 there is no block above it, this value is checked for determining whether
22 sunlight comes from the top.
23 - 0x02: day_night_differs: Whether the lighting of the block is different on
24 day and night. Only blocks that have this bit set are updated when day
26 - 0x04: lighting_expired: If true, lighting is invalid and should be updated.
27 If you can't calculate lighting in your generator properly, you could try
28 setting this 1 to everything and setting the uppermost block in every
29 sector as is_underground=0. I am quite sure it doesn't work properly,
32 zlib-compressed map data:
34 u8[4096]: content types
35 u8[4096]: param1 values
36 u8[4096]: param2 values
38 zlib-compressed node metadata
43 u16 position (= p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X)
46 u8[content_size] misc. stuff contained in the metadata
48 u16 mapblockobject_count
50 - if read != 0, just fail.
52 foreach mapblockobject_count:
53 - deprecated, should not be used. Length of this data can only be known by
54 properly parsing it. Just hope not to run into any of this.
56 u8 static object version:
59 u16 static_object_count
61 foreach static_object_count:
62 u8 type (object type-id)
70 - Timestamp when last saved, as seconds from starting the game.
71 - 0xffffffff = invalid/unknown timestamp, nothing will be done with the time
72 difference when loaded (recommended)