1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add callback to preserve node metadata as item metadata

This commit is contained in:
ashtrayoz 2017-11-09 23:29:04 +11:00 committed by paramat
parent 6e5109fd46
commit abd8a30c05
3 changed files with 36 additions and 1 deletions

View file

@ -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