summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2021-05-30 20:24:12 +0200
committerGitHub <noreply@github.com>2021-05-30 20:24:12 +0200
commitc9144ae5e22ee041fed2512cd3055608c6e9a4bc (patch)
treebcdcf98233034af6b6cf10f61dde0d1711bac068 /doc/lua_api.txt
parent89f3991351185b365ccd10525e74d35d7bb2da46 (diff)
downloadminetest-c9144ae5e22ee041fed2512cd3055608c6e9a4bc.tar.gz
minetest-c9144ae5e22ee041fed2512cd3055608c6e9a4bc.tar.bz2
minetest-c9144ae5e22ee041fed2512cd3055608c6e9a4bc.zip
Add core.compare_block_status function (#11247)
Makes it possible to check the status of the mapblock in a future-extensible way.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 956919c89..0f57f1f28 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -5863,6 +5863,19 @@ Misc.
* If `transient` is `false` or absent, frees a persistent forceload.
If `true`, frees a transient forceload.
+* `minetest.compare_block_status(pos, condition)`
+ * Checks whether the mapblock at positition `pos` is in the wanted condition.
+ * `condition` may be one of the following values:
+ * `"unknown"`: not in memory
+ * `"emerging"`: in the queue for loading from disk or generating
+ * `"loaded"`: in memory but inactive (no ABMs are executed)
+ * `"active"`: in memory and active
+ * Other values are reserved for future functionality extensions
+ * Return value, the comparison status:
+ * `false`: Mapblock does not fulfil the wanted condition
+ * `true`: Mapblock meets the requirement
+ * `nil`: Unsupported `condition` value
+
* `minetest.request_insecure_environment()`: returns an environment containing
insecure functions if the calling mod has been listed as trusted in the
`secure.trusted_mods` setting or security is disabled, otherwise returns