Skip to content

Commit 691eb2d

Browse files
committed
Document current node metadata format
Document the node metadata changes of the commit (serialisation version >=23): 704782c "WIP node metadata, node timers"
1 parent 94f1e5d commit 691eb2d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

doc/world_format.txt

+18-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ NOTE: Zlib data is in such a format that Python's zlib at least can
250250
directly decompress.
251251

252252
u8 version
253-
- map format version number, this one is version 22
253+
- map format version number, see serialisation.h for the latest number
254254

255255
u8 flags
256256
- Flag bitmasks:
@@ -296,13 +296,26 @@ if content_width == 2:
296296

297297
zlib-compressed node metadata list
298298
- content:
299+
if map format version <= 22:
299300
u16 version (=1)
300301
u16 count of metadata
301302
foreach count:
302303
u16 position (p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X)
303304
u16 type_id
304305
u16 content_size
305-
u8[content_size] (content of metadata)
306+
u8[content_size] content of metadata. Format depends on type_id, see below.
307+
if map format version >= 23:
308+
u8 version (=1) -- Note the type is u8, while for map format version <= 22 it's u16
309+
u16 count of metadata
310+
foreach count:
311+
u16 position (p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X)
312+
u32 num_vars
313+
foreach num_vars:
314+
u16 key_len
315+
u8[name_len] key
316+
u32 val_len
317+
u8[val_len] value
318+
serialized inventory
306319

307320
- Node timers
308321
if map format version == 23:
@@ -378,8 +391,9 @@ The name-id-mapping
378391
--------------------
379392
The mapping maps node content ids to node names.
380393

381-
Node metadata format
382-
---------------------
394+
Node metadata format for map format versions <= 22
395+
---------------------------------------------------
396+
The node metadata are serialized depending on the type_id field.
383397

384398
1: Generic metadata
385399
serialized inventory

0 commit comments

Comments
 (0)