Expand description
The binary form — what the build compiles content to and the runtime and the Java hosts read, like NBT:
"YOGD" version:u8
strings: varint count, then each as varint length + UTF-8
root valueA value is a tag byte and its payload; every string (map keys too) is an index into the table, so repeated keys and ids cost one varint each.
| Tag | Value | Payload |
|---|---|---|
| 0 | null | — |
| 1, 2 | false, true | — |
| 3 | int | zigzag varint |
| 4 | float | f64, little-endian |
| 5 | string | string |
| 6 | list | varint count, values |
| 7 | map | varint count, (key string, value) pairs |
| 8 | ref | kind string, id string |
| 9 | tag | kind string, id string |
| 10 | resource | set string, key string |
| 11 | text | string |
| 12 | image | string |
| 13 | color | u32, little-endian (0xAARRGGBB) |
| 14 | translation key | string |
Varints are LEB128. Decoding checks every length against the input, so malformed bytes are an error, never a panic or a huge allocation.
Structs§
- Decode
Error - Malformed binary data.