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

Add after_destruct and cache the existence of on_construct, on_destruct and after_destruct for quick skipping when a node does not have them

This commit is contained in:
Perttu Ahola 2012-06-05 23:51:37 +03:00
parent c3658e7c79
commit 3a0562bebc
6 changed files with 74 additions and 12 deletions

View file

@ -1150,15 +1150,18 @@ Node definition (register_node)
on_destruct = func(pos),
^ Node destructor; always called before removing node
^ default: nil
after_destruct = func(pos, oldnode),
^ Node destructor; always called after removing node
^ default: nil
after_place_node = func(pos, placer),
^ Called after constructing node when node was placed using
minetest.item_place_node
minetest.item_place_node / minetest.env:place_node
^ default: nil
after_dig_node = func(pos, oldnode, oldmetadata, digger),
^ oldmetadata is in table format
^ Called after destructing node when node was dug using
minetest.node_dig
minetest.node_dig / minetest.env:dig_node
^ default: nil
can_dig = function(pos,player)
^ returns true if node can be dug, or false if not