Seasons api

This commit is contained in:
2026-10-08 13:42:18 -03:00
parent 7e7ac8f6f4
commit dd66d6caa7
16 changed files with 231 additions and 10 deletions
+5 -3
View File
@@ -69,8 +69,9 @@ component.
| `on_second(block, params, dt)` | Every second, near a player. | |
| `on_new_day(block, params, day)` | Every morning at 06:00, anywhere in the world. | |
`block` is `{ id, x, y, z, data }`, where `data` is the block's [tile data](tiledata.md). `params` is what the block's
JSON lists for this component, and `dt` is in seconds.
`block` is `{ id, x, y, z, biome, season, data }`, where `data` is the block's [tile data](tiledata.md) and `biome` and
`season` are its column's (see [Seasons](../worldgen/biomes.md#seasons)). `params` is what the block's JSON lists for
this component, and `dt` is in seconds.
## Rules
@@ -96,7 +97,8 @@ export function setup(ctx: SharedContext) {
| `on_neighbor_change(block, params, neighbor)` | A block on one of its 6 sides is placed, broken or changes its states. | |
Here `block` is `{ id, x, y, z }`, without tile data, which clients never have. `ctx.world` in a shared script has
`get_block`, `get_state`, `set_state` and `is_face_sturdy`, and only works inside rules.
`get_block`, `get_state`, `set_state`, `is_face_sturdy`, `biome_at` and `season_at` (see
[Seasons](../worldgen/biomes.md#seasons)), and only works inside rules.
### Neighbors