diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-09-03 22:05:07 -0400 |
---|---|---|
committer | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-12-24 08:24:59 -0500 |
commit | 5c248c2d7de3db54e85f7c388743a2eb8e36fee4 (patch) | |
tree | b0d27690b3e852b207345dc5e00dc4457a7e6268 /doc/lua_api.txt | |
parent | 7701e70dc92262c41d68cf1c9f7fbd0c333e5c52 (diff) | |
download | minetest-5c248c2d7de3db54e85f7c388743a2eb8e36fee4.tar.xz |
Add callback on_mapblocks_changed
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r-- | doc/lua_api.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 6f2f6c307..b41189e9c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -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 --------------- |