This commit is contained in:
2026-11-21 09:10:49 -03:00
parent f36176a872
commit c4eda256a1
+6 -5
View File
@@ -36,8 +36,9 @@ Positions are from the box's lowest corner.
## Placing ## Placing
A mod's `schematics/<name>.cbsm` files are its schematics `<mod id>:<name>`, so an exported file can be dropped in as it A mod's `schematics/<name>.cbsm` files are its schematics `<mod id>:<name>`, so an exported file can be dropped in as it
is. `check-mods` checks that every block and entity in them exists. They're registered before any script runs, so a is. `check-mods` checks that every block and entity in them exists. A missing block is only a warning: it's left out
server phase can place them right away. Players never download them. when the schematic loads, so one made with blocks from another mod still works without it. They're registered before any
script runs, so a server phase can place them right away. Players never download them.
A script can also register one it made itself, by id in the server phase, then place it by that id: A script can also register one it made itself, by id in the server phase, then place it by that id:
@@ -50,9 +51,9 @@ ctx.schematics.place("copper_tools:hut", {
}); });
``` ```
`register` checks it right away, so a schematic with a block, state or entity that isn't registered stops the mod from `register` checks it right away, so a schematic with a state or entity that isn't registered stops the mod from loading,
loading, instead of failing when it's placed. It takes a `Schematic` (exported from `cubi/server`), the same shape as a instead of failing when it's placed. Blocks that aren't registered are left out, with a warning. It takes a `Schematic`
file's. (exported from `cubi/server`), the same shape as a file's.
`place` puts the whole schematic in at once, replacing what was there, air too: `place` puts the whole schematic in at once, replacing what was there, air too: