mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make sure generated blocks have their timestamp set
behavior change: newly generated blocks are no longer momentarily activated. this shouldn't matter for anyone and did not consistently apply to all blocks anyway addresses issue from #15902 for new maps(!)
This commit is contained in:
parent
ed40ea010b
commit
7b746d21f9
8 changed files with 66 additions and 32 deletions
|
@ -9479,12 +9479,17 @@ Used by `core.register_lbm`.
|
|||
|
||||
A loading block modifier (LBM) is used to define a function that is called for
|
||||
specific nodes (defined by `nodenames`) when a mapblock which contains such nodes
|
||||
gets activated (not loaded!).
|
||||
gets activated (**not loaded!**).
|
||||
|
||||
Note: LBMs operate on a "snapshot" of node positions taken once before they are triggered.
|
||||
*Note*: LBMs operate on a "snapshot" of node positions taken once before they are triggered.
|
||||
That means if an LBM callback adds a node, it won't be taken into account.
|
||||
However the engine guarantees that when the callback is called that all given position(s)
|
||||
contain a matching node.
|
||||
However the engine guarantees that at the point in time when the callback is called
|
||||
that all given positions contain a matching node.
|
||||
|
||||
*Note*: For maps generated in 5.11.0 or older, many newly generated blocks did not
|
||||
get a timestamp set. This means LBMs introduced between generation time and
|
||||
time of first activation will never run.
|
||||
Currently the only workaround is to use `run_at_every_load`.
|
||||
|
||||
```lua
|
||||
{
|
||||
|
@ -9508,7 +9513,7 @@ contain a matching node.
|
|||
action = function(pos, node, dtime_s) end,
|
||||
-- Function triggered for each qualifying node.
|
||||
-- `dtime_s` is the in-game time (in seconds) elapsed since the block
|
||||
-- was last active.
|
||||
-- was last active (available since 5.7.0).
|
||||
|
||||
bulk_action = function(pos_list, dtime_s) end,
|
||||
-- Function triggered with a list of all applicable node positions at once.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue