Skip to content

Commit

Permalink
Correct lua_api.txt docs related to meta (#5198)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy authored and nerzhul committed Feb 10, 2017
1 parent 5707b73 commit 74b670a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions doc/lua_api.txt
Expand Up @@ -2815,15 +2815,22 @@ See `StorageRef`, `NodeMetaRef` and `ItemStackMetaRef`.

### `NodeMetaRef`
Node metadata: reference extra data and functionality stored in a node.
Can be gotten via `minetest.get_meta(pos)`.
Can be obtained via `minetest.get_meta(pos)`.

#### Methods
* All methods in MetaDataRef
* `get_inventory()`: returns `InvRef`

### `ItemStackMetaRef`
ItemStack metadata: reference extra data and functionality stored in a stack.
Can be gotten via `item:get_meta()`.
Can be obtained via `item:get_meta()`.

#### Methods
* All methods in MetaDataRef

### `StorageRef`
Mod metadata: per mod metadata, saved automatically.
Can be obtained via `minetest.get_mod_storage()` during load time.

#### Methods
* All methods in MetaDataRef
Expand All @@ -2850,9 +2857,6 @@ 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.

Expand Down Expand Up @@ -3100,8 +3104,9 @@ an itemstring, a table or `nil`.
* `set_count(count)`: Returns boolean whether item was cleared
* `get_wear()`: Returns tool wear (`0`-`65535`), `0` for non-tools.
* `set_wear(wear)`: Returns boolean whether item was cleared
* `get_metadata()`: Returns metadata (a string attached to an item stack).
* `set_metadata(metadata)`: Returns true.
* `get_meta()`: Returns ItemStackMetaRef. See section for more details
* `get_metadata()`: (DEPRECATED) Returns metadata (a string attached to an item stack).
* `set_metadata(metadata)`: (DEPRECATED) Returns true.
* `clear()`: removes all items from the stack, making it empty.
* `replace(item)`: replace the contents of this stack.
* `item` can also be an itemstring or table.
Expand Down

0 comments on commit 74b670a

Please sign in to comment.