summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-02-08 00:15:55 +0100
committerGitHub <noreply@github.com>2017-02-08 00:15:55 +0100
commitef6feca501fcf0d5a1fd2021f1d4df96a4533f65 (patch)
tree58361be1085c91222ab9c0cad507ca70a87dfe8e /doc
parent0680c47d6c7d3e98e2b96b823f8cc9ca76d5e7f8 (diff)
downloadminetest-ef6feca501fcf0d5a1fd2021f1d4df96a4533f65.tar.gz
minetest-ef6feca501fcf0d5a1fd2021f1d4df96a4533f65.tar.bz2
minetest-ef6feca501fcf0d5a1fd2021f1d4df96a4533f65.zip
Add ModMetadata API (#5131)
* mod can create a ModMetadata object where store its values and retrieve it. * Modmetadata object can only be fetched at mod loading * Save when modified using same time as map interval or at server stop * add helper function to get mod storage path * ModMetadata has exactly same calls than all every other Metadata
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index dd20ae904..4774e8a5a 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2629,6 +2629,11 @@ These functions return the leftover itemstack.
* `HTTPApiTable.fetch_async_get(handle)`: returns HTTPRequestResult
* Return response data for given asynchronous HTTP request
+### Storage API:
+* `minetest.get_mod_storage()`:
+ * returns reference to mod private `StorageRef`
+ * must be called during mod load time
+
### Misc.
* `minetest.get_connected_players()`: returns list of `ObjectRefs`
* `minetest.player_exists(name)`: boolean, whether player exists (regardless of online status)
@@ -2791,7 +2796,7 @@ Class reference
---------------
### `MetaDataRef`
-See `NodeMetaRef` and `ItemStackMetaRef`.
+See `StorageRef`, `NodeMetaRef` and `ItemStackMetaRef`.
#### Methods
* `set_string(name, value)`
@@ -2845,6 +2850,9 @@ Can be gotten via `minetest.get_node_timer(pos)`.
* `is_started()`: returns boolean state of timer
* returns `true` if timer is started, otherwise `false`
+### `StorageRef`
+This is basically a reference to a C++ `ModMetadata`
+
### `ObjectRef`
Moving things in the game are generally these.