Skip to content

Commit

Permalink
Support an on-move callback (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Desour authored and numberZero committed Oct 5, 2017
1 parent 0b3039e commit 8999597
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mesecons_mvps/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8999597

Please sign in to comment.