aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-04-30 17:42:51 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-04-30 18:42:51 +0200
commit0b5b32b026291d5bd8e47acebca10259a379fc1c (patch)
tree6e308bb5ccf3fb3050a40cd784456387c67b106e /doc/lua_api.txt
parent54606e103d5b2d2bace6d57c45e48804c5dec487 (diff)
downloadhax-minetest-server-0b5b32b026291d5bd8e47acebca10259a379fc1c.tar.gz
hax-minetest-server-0b5b32b026291d5bd8e47acebca10259a379fc1c.zip
MetaDataRef: Add contains() and get() (#7214)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 321c2abc6..5442612af 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -3909,12 +3909,15 @@ An interface to use mod channels on client and server
See `StorageRef`, `NodeMetaRef`, `ItemStackMetaRef`, and `PlayerMetaRef`.
#### Methods
-* `set_string(name, value)`
-* `get_string(name)`
-* `set_int(name, value)`
-* `get_int(name)`
-* `set_float(name, value)`
-* `get_float(name)`
+* `contains(key)`: Returns true if key present, otherwise false.
+ * Returns `nil` when the MetaData is inexistent.
+* `get(key)`: Returns `nil` if key not present, else the stored string.
+* `set_string(key, value)`: Value of `""` will delete the key.
+* `get_string(key)`: Returns `""` if key not present.
+* `set_int(key, value)`
+* `get_int(key)`: Returns `0` if key not present.
+* `set_float(key, value)`
+* `get_float(key)`: Returns `0` if key not present.
* `to_table()`: returns `nil` or a table with keys:
* `fields`: key-value storage
* `inventory`: `{list1 = {}, ...}}` (NodeMetaRef only)