Skip to content
Permalink
Browse files

Support an on-move callback (#363)

  • Loading branch information...
DS-Minetest authored and numberZero committed Oct 5, 2017
1 parent 0b3039e commit 8999597df2d4d5b5aa2011eb9880dfc758201a5a
Showing with 10 additions and 0 deletions.
  1. +10 −0 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)

0 comments on commit 8999597

Please sign in to comment.
You can’t perform that action at this time.