summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-06-20 09:19:56 +0000
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commit322e5aaf9285e9686101393967f1a3c1e7db986c (patch)
tree27333ec46921d624cbe96b3d082a0cf189239e90 /doc/lua_api.txt
parent03bc584f5738e21ef6c07e7c0928d0083be9995e (diff)
downloadminetest-322e5aaf9285e9686101393967f1a3c1e7db986c.tar.gz
minetest-322e5aaf9285e9686101393967f1a3c1e7db986c.tar.bz2
minetest-322e5aaf9285e9686101393967f1a3c1e7db986c.zip
Automatic item and node colorization (#5640)
* Automatic item and node colorization Now nodes with a palette yield colored item stacks, and colored items place colored nodes by default. The client predicts the colorization. * Backwards compatibility * Use nil * Style fixes * Fix code style * Document changes
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index e893d6461..aefcba064 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -531,9 +531,11 @@ for conversion.
If the `ItemStack`'s metadata contains the `color` field, it will be
lost on placement, because nodes on the map can only use palettes.
-If the `ItemStack`'s metadata contains the `palette_index` field, you
-currently must manually convert between it and the node's `param2` with
-custom `on_place` and `on_dig` callbacks.
+If the `ItemStack`'s metadata contains the `palette_index` field, it is
+automatically transferred between node and item forms by the engine,
+when a player digs or places a colored node.
+You can disable this feature by setting the `drop` field of the node
+to itself (without metadata).
### Colored items in craft recipes
Craft recipes only support item strings, but fortunately item strings
@@ -3323,8 +3325,9 @@ An `InvRef` is a reference to an inventory.
* `add_item(listname, stack)`: add item somewhere in list, returns leftover `ItemStack`
* `room_for_item(listname, stack):` returns `true` if the stack of items
can be fully added to the list
-* `contains_item(listname, stack)`: returns `true` if the stack of items
- can be fully taken from the list
+* `contains_item(listname, stack, [match_meta])`: returns `true` if
+ the stack of items can be fully taken from the list.
+ If `match_meta` is false, only the items' names are compared (default: `false`).
* `remove_item(listname, stack)`: take as many items as specified from the list,
returns the items that were actually removed (as an `ItemStack`) -- note that
any item metadata is ignored, so attempting to remove a specific unique