specs/schematic: add single space before version number

This commit is contained in:
Starbeamrainbowlabs 2023-08-11 22:30:26 +01:00
parent ec95c64315
commit a39b2191a5
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -94,7 +94,7 @@ WEASCHEM1
<nl> ::= "\n"
<magic_bytes> ::= WEASCHEM <version> <nl>
<magic_bytes> ::= WEASCHEM " " <version> <nl>
<version> ::= <number>
<number> ::= <digit> | <digit> <number>
@ -109,17 +109,19 @@ The non-terminal tokens `<header>`, `<id_map>`, and `<data_table>` are defined b
A full (trivial) example file is given below:
```
WEASCHEM
WEASCHEM 1
{"name":"Test schematic","description": "Some description","size":{"x":5,"y":3,"z":4},"offset":{"x":1,"y":0,"z":2},"type":"full","generator": "WorldEditAdditions v1.14"}
{"0":"default:air","5":"default:stone","14":"default:dirt"}
10x5,40x14,0,5,14,5,14,5x0
```
## Magic bytes
The string `WEASCHEM` is always present at the beginning of a WorldEditAdditions schematic file, followed directly by an integer version number.
The string `WEASCHEM` is always present at the beginning of a WorldEditAdditions schematic file, followed a a single space ` ` U+20, then an integer version number.
This specification, as noted above, described WorldEditAdditions schematic files version `1`. It is RECOMMENDED that implementers reject schematic files with a version number that they do not support parsing with a useful error message.
For example, `WEASCHEM 1` defines a schematic file of version 1.
## Header
The header of the file contains all the metadata about the schematic required to restore it into the world. The header is defined as a JSON object on a single line, followed by a new line (`\n` U+0A):