aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-06-20 09:19:56 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-20 11:19:56 +0200
commit0fcaf9fb1b61caaf8ed78a5d3005b1d9d1c43b57 (patch)
tree39b19a3fa61dc29b921739a26d7598222cdbd5f3 /doc
parent7c07cb4ec23ebb0f3d5f3d913bea205660515836 (diff)
downloadminetest-0fcaf9fb1b61caaf8ed78a5d3005b1d9d1c43b57.tar.gz
minetest-0fcaf9fb1b61caaf8ed78a5d3005b1d9d1c43b57.tar.bz2
minetest-0fcaf9fb1b61caaf8ed78a5d3005b1d9d1c43b57.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')
-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 a3413221b..9bd92b34a 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
@@ -3326,8 +3328,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