mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Bulk LBMs (#14954)
This commit is contained in:
parent
7ae51382c8
commit
811adf5d42
9 changed files with 126 additions and 49 deletions
|
@ -5522,6 +5522,8 @@ Utilities
|
|||
override_item_remove_fields = true,
|
||||
-- The predefined hotbar is a Lua HUD element of type `hotbar` (5.10.0)
|
||||
hotbar_hud_element = true,
|
||||
-- Bulk LBM support (5.10.0)
|
||||
bulk_lbms = true,
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9124,7 +9126,12 @@ Used by `minetest.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.
|
||||
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.
|
||||
|
||||
```lua
|
||||
{
|
||||
|
@ -9148,7 +9155,13 @@ gets activated (not loaded!)
|
|||
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.
|
||||
|
||||
bulk_action = function(pos_list, dtime_s) end,
|
||||
-- Function triggered with a list of all applicable node positions at once.
|
||||
-- This can be provided as an alternative to `action` (not both).
|
||||
-- Available since `minetest.features.bulk_lbms` (5.10.0)
|
||||
-- `dtime_s`: as above
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue