Placing schematics

This commit is contained in:
2026-11-15 19:01:40 -03:00
parent 59bfed58bf
commit 6bb2c87373
10 changed files with 464 additions and 50 deletions
+8 -1
View File
@@ -73,10 +73,17 @@ Blocks without the hooks just copy data unchanged, which is fine for plain field
### Placing schematics
Built without `import_data`, see `docs/modding/misc/schematics.md`:
```typescript
ctx.schematics.place(id, { position, dimension, position_pivot, rotation, mirror });
ctx.schematics.register(id, schematic);
ctx.schematics.place(id, { position, position_pivot, rotation, mirror });
```
`register` takes a `Schematic` object for now, loading them from mods' schematics directories isn't built. There's no
`dimension` yet, like export. Blocks with data in the schematic get it as it is and skip `on_create`, the rest get their
`on_create`, then every placed block tells its neighbors.
### Rotation and mirroring
- `rotation` is `0`, `90`, `180` or `270` degrees clockwise seen from above, the same as the `"y"` of a block variant