-
Notifications
You must be signed in to change notification settings - Fork 1
/
SLIME_FORMAT
97 lines (87 loc) · 3.07 KB
/
SLIME_FORMAT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
-------------------------------------
“Slime” file format
2 bytes - magic = 0xB10B
1 byte (ubyte) - version, current = 0x09
1 byte (ubyte) - world version (see version list below)
2 bytes (short) - xPos of chunk lowest x & lowest z
2 bytes (short) - zPos
2 bytes (ushort) - width
2 bytes (ushort) - depth
[depends] - chunk bitmask
-> each chunk is 1 bit: 0 if all air (missing), 1 if present
-> chunks are ordered zx, meaning
-> the last byte has unused bits on the right
-> size is ceil((width*depth) / 8) bytes
4 bytes (int) - compressed chunks size
4 bytes (int) - uncompressed chunks size
<array of chunks> (size determined from bitmask)
compressed using zstd
4 bytes (int) - compressed tile entities size
4 bytes (int) - uncompressed tile entities size
<array of tile entity nbt compounds>
Same format as mc
inside an nbt list named “tiles”, in a global compound, no gzip anywhere
compressed using zstd
1 byte (boolean) - has entities
[if has entities]
4 bytes (int) compressed entities size
4 bytes (int) uncompressed entities size
<array of entity nbt compounds>
Same format as mc EXCEPT optional “CustomId”
inside an nbt list named “entities”, in a global compound
Compressed using zstd
4 bytes (int) - compressed “extra” size
4 bytes (int) - uncompressed “extra” size
[depends] - compound tag compressed using zstd
4 bytes (int) - compressed world maps size
4 bytes (int) - uncompressed world maps size
<array of tile entity nbt compounds>
Same format as mc, with a new "id" int tag
inside an nbt list named “maps”, in a global compound, no gzip anywhere
compressed using zstd
-------------------------------------
Custom chunk format
[if world mc version is 1.13 or newer]
4 bytes (int) - heightmaps size
<array of heightmap nbt compounds>
same format as mc, uncompressed
4 bytes (int) - biome array size
<array of biomes (ints)>
[else]
256 ints - heightmap
256 bytes - biomes
2 bytes - sections bitmask (bottom to top)
1 byte (boolean) - has block light
[if has block light]
2048 bytes - block light
[if world mc version is 1.13 or newer]
4 bytes (int) - block palette array size
<array of block palette nbt compounds>
same format as mc, without being inside a global compound
4 bytes (int) - block state array size
<array of block states (longs)>
[else]
4096 bytes - blocks
2048 bytes - data
1 byte (boolean) - has sky light
[if has sky light]
2048 bytes - sky light
For each section
-------------------------------------
World version list:
- 1: 1.8 world
- 2: 1.9 world
- 3: 1.11 world
- 4: 1.13 world
- 5: 1.14 world
-------------------------------------
Version history:
- v1: Initial release.
- v2: Added "extra" nbt tag for per-world custom data.
- v3: Added entities storage.
- v4: Added support for 1.13 worlds and removed HypixelBlocks3.
- v5: Skylight and blocklight might not always be present.
- v6: Added world versioning
- v7: Added world maps
- v8: Variable biomes size
- v9: Fix issue with biomes size, causing old worlds to be corrupted