Blockscape File format Version 5 (beta) Copyright 2012 ioneo Information -------------------------------------------------------- The format is chunk based. The format is designed to always be backwards compatible and forward compatible when possible. All chunks (except the Blockscape chunk!) have the following layout: +---------------------------+ | id | ushort | +---------+-----------------+ | length | int | +---------+-----------------+ | data | | +---------+-----------------+ Value of length is the length of the chunk excluding the length of id and length. The length field makes it possible for applications to read only those chunks it knows or is interested in and skip other chunks. Chunks -------------------------------------------------------- Blockscape ---------- This chunk is special because it has no length. This chunk is the only chunk that is required. This chunk must be the first chunk in the file. type name value +---------+---------+--------+ | ushort | id | 0 | +---------+---------+--------+ | int | version | 4 | +---------+---------+--------+ World type ---------- type name value +---------+---------+----------------------+ | ushort | id | 9 | +---------+---------+----------------------+ | int | length | 4 | +---------+---------+----------------------+ | int | type | 0 = Normal | | | | 1 = Infinte plane | +---------+---------+----------------------+ Name ---- type name value +----------+---------+----------------------+ | ushort | id | 3 | +----------+---------+----------------------+ | int | length | 16 | +----------+---------+----------------------+ | byte[16] | name | | +----------+---------+----------------------+ World seed ---------- type name value +----------+---------+----------------------+ | ushort | id | 8 | +----------+---------+----------------------+ | int | length | 4 | +----------+---------+----------------------+ | int | seed | | +----------+---------+----------------------+ Player position --------------- type name value +----------+---------+----------------------+ | ushort | id | 1 | +----------+---------+----------------------+ | int | length | 3*8 | +----------+---------+----------------------+ | double | x | | +----------+---------+----------------------+ | double | y | | +----------+---------+----------------------+ | double | z | | +----------+---------+----------------------+ Game type --------- type name value +---------+---------+----------------------+ | ushort | id | 7 | +---------+---------+----------------------+ | int | length | 1 | +---------+---------+----------------------+ | byte | type | 0 = Normal | | | | 1 = God | +---------+---------+----------------------+ World chunk ----------- This chunk contains sub chunks. type name value +----------+---------+----------------------+ | ushort | id | 2 | +----------+---------+----------------------+ | int | length | n | +----------+---------+----------------------+ | ... | ... | ... | +----------+---------+----------------------+ World Chunk Position -------------------- parent: World chunk Is the first Chunk in each WorldChunk Specifies the Position of the World Chunk in the world chunk 3d grid type name value +----------+---------+----------------------+ | ushort | id | 12 | +----------+---------+----------------------+ | int | length | 3*4 | +----------+---------+----------------------+ | int | x | | +----------+---------+----------------------+ | int | y | | +----------+---------+----------------------+ | int | z | | +----------+---------+----------------------+ Block layer ----------- parent: World chunk This chunk represents one horizontal slice of a world chunk. type name value +--------------+---------+----------------------+ | ushort | id | 13 | +--------------+---------+----------------------+ | int | length | 1+2*32^2 | +--------------+---------+----------------------+ | int | y | relative y position | +--------------+---------+----------------------+ | byte[2*32^2] | blocks | * | +--------------+---------+----------------------+ * Every block is represented by 2 bytes. byte 0: 00xx xxxx is the block type byte 1: 0xxx xxxx is the block material Block layer 2 ----------- parent: World chunk This chunk represents one horizontal slice of a world chunk. type name value +--------------+---------+----------------------+ | ushort | id | 13 | +--------------+---------+----------------------+ | int | length | 1+2*32^2 | +--------------+---------+----------------------+ | int | y | relative y position | +--------------+---------+----------------------+ | byte[2*32^2] | blocks | * | +--------------+---------+----------------------+ * Every block is represented by 3 bytes. byte 0: 00xx xxxx is the block type byte 1: 0xxx xxxx is the block material byte 2: xxxx 0000 is the fluid type byte 2: 0000 xxxx is the fluid value