From abd8a30c0542c75622d8e2b46e3529c9e798d227 Mon Sep 17 00:00:00 2001 From: ashtrayoz <33517241+ashtrayoz@users.noreply.github.com> Date: Thu, 9 Nov 2017 23:29:04 +1100 Subject: Add callback to preserve node metadata as item metadata --- doc/lua_api.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index d3b493fc3..7ffd17a42 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4710,6 +4710,13 @@ Definition tables ^ interval. Default: nil. ^ Warning: making a liquid node 'floodable' does not work and may cause problems. ]] + preserve_metadata = func(pos, oldnode, oldmeta, drops) --[[ + ^ Called when oldnode is about be converted to an item, but before the + node is deleted from the world or the drops are added. This is generally + the result of either the node being dug or an attached node becoming detached. + ^ drops is a table of ItemStacks, so any metadata to be preserved can be + added directly to one or more of the dropped items. See "ItemStackMetaRef". + ^ default: nil ]] after_place_node = func(pos, placer, itemstack, pointed_thing) --[[ ^ Called after constructing node when node was placed using minetest.item_place_node / minetest.place_node -- cgit v1.2.3