aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-09-03 22:05:07 -0400
committerJude Melton-Houghton <jwmhjwmh@gmail.com>2022-12-24 08:24:59 -0500
commit5c248c2d7de3db54e85f7c388743a2eb8e36fee4 (patch)
treeb0d27690b3e852b207345dc5e00dc4457a7e6268 /doc/lua_api.txt
parent7701e70dc92262c41d68cf1c9f7fbd0c333e5c52 (diff)
downloadminetest-5c248c2d7de3db54e85f7c388743a2eb8e36fee4.tar.xz
Add callback on_mapblocks_changed
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt10
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
---------------