1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Add callback on_mapblocks_changed

This commit is contained in:
Jude Melton-Houghton 2022-09-03 22:05:07 -04:00
parent 7701e70dc9
commit 5c248c2d7d
10 changed files with 141 additions and 6 deletions

View file

@ -5372,6 +5372,16 @@ Call these functions only at load time!
* `pos_list` is an array of all modified positions.
* `node_list` is an array of the old node that was previously at the position
with the corresponding index in pos_list.
* `minetest.register_on_mapblocks_changed(function(modified_blocks, modified_block_count))`
* Called soon after any nodes or node metadata have been modified. No
modifications will be missed, but there may be false positives.
* Will never be called more than once per server step.
* `modified_blocks` is the set of modified mapblock position hashes. These
are in the same format as those produced by `minetest.hash_node_position`,
and can be converted to positions with `minetest.get_position_from_hash`.
The set is a table where the keys are hashes and the values are `true`.
* `modified_block_count` is the number of entries in the set.
* Note: callbacks must be registered at mod load time.
Setting-related
---------------