Real ctx.world.is_loaded implementation

This commit is contained in:
2026-10-20 14:00:21 -03:00
parent 2c1eaf5735
commit 987e7a0f9a
5 changed files with 49 additions and 3 deletions
+5
View File
@@ -117,6 +117,11 @@ Two more things in `ctx.world` are for blocks that tell others themselves:
around it, for a script that tells them itself, so a long line of blocks changing together tells each block beside it
once instead of once per block. `on_state_change` still runs.
Code that reaches far from a block, like a walk along something long, checks `ctx.world.is_loaded(x, z)` before it reads
a column: whether that column's chunk was ever generated. Reading a block anywhere else generates its chunk on the spot,
which takes a while, and nobody can have built anything there, so a walk stops at those chunks. A chunk that's saved but
not in memory counts as loaded, and reading it reads it from the save.
## Rules
A component's rules decide a block's states from where it's placed, what's around it and being right clicked. They're