diff options
author | DS <vorunbekannt75@web.de> | 2017-10-05 23:09:48 +0200 |
---|---|---|
committer | Vitaliy <silverunicorn2011@yandex.ru> | 2017-10-06 00:09:48 +0300 |
commit | 8999597df2d4d5b5aa2011eb9880dfc758201a5a (patch) | |
tree | 89c56de4c9711cf3508f1a7c1594191050e5ae86 /mesecons_mvps | |
parent | 0b3039e9a9cd336356496d8d08e272d7483bf64a (diff) |
Support an on-move callback (#363)
Diffstat (limited to 'mesecons_mvps')
-rw-r--r-- | mesecons_mvps/init.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 08c4785..a335f25 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -255,3 +255,13 @@ mesecon.register_mvps_stopper("doors:door_steel_b_2") mesecon.register_mvps_stopper("doors:door_steel_t_2") mesecon.register_mvps_stopper("default:chest_locked") mesecon.register_on_mvps_move(mesecon.move_hot_nodes) +mesecon.register_on_mvps_move(function(moved_nodes) + for i = 1, #moved_nodes do + local moved_node = moved_nodes[i] + local node_def = minetest.registered_nodes[moved_node.node.name] + if node_def and node_def.mesecon and node_def.mesecon.on_mvps_move then + node_def.mesecon.on_mvps_move(moved_node.pos, moved_node.node, + moved_node.oldpos, moved_node.meta) + end + end +end) |