1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Add proff of concept for blocks callback.

This commit is contained in:
SFENCE 2025-04-09 20:27:26 +02:00
parent a00b9cab36
commit 18c740712a
7 changed files with 212 additions and 0 deletions

View file

@ -6636,6 +6636,17 @@ Environment access
* mode = `"quick"`: Clear objects immediately in loaded mapblocks,
clear objects in unloaded mapblocks only when the
mapblocks are next activated.
* `core.blocks_callback(options)`
* Call Lua function over all loaded or loadable blocks
* Takes an table as an argument with the fields:
* `mode`
* mode = "full": Load and go through every mapblock, clearing objects (default).
* mode = "quick": Clear objects immediately in loaded mapblocks, clear objects in unloaded mapblocks only when the mapblocks are next activated.
* `callback`: Lua callback function function(name, staticdata, params.
* `blockpos_hash`: block position hash compatible with `core.hash_node_position` and `core.get_position_from_hash`
* `params`: Some Lua value.
* `params`: Params for Lua callback functions.
* `core.load_area(pos1[, pos2])`
* Load the mapblocks containing the area from `pos1` to `pos2`.
`pos2` defaults to `pos1` if not specified.