Redstone: Add basic blastnode handling

This commit is contained in:
Wuzzy 2018-01-30 06:01:36 +01:00
parent d750e7f6d4
commit b7b6f356fa
2 changed files with 8 additions and 0 deletions

@ -95,6 +95,13 @@ mesecon.on_dignode = function(pos, node)
mesecon.execute_autoconnect_hooks_queue(pos, node) mesecon.execute_autoconnect_hooks_queue(pos, node)
end end
mesecon.on_blastnode = function(pos, node)
local node = minetest.get_node(pos)
minetest.remove_node(pos)
mesecon.on_dignode(pos, node)
return minetest.get_node_drops(node.name, "")
end
minetest.register_on_placenode(mesecon.on_placenode) minetest.register_on_placenode(mesecon.on_placenode)
minetest.register_on_dignode(mesecon.on_dignode) minetest.register_on_dignode(mesecon.on_dignode)

@ -248,6 +248,7 @@ end
function mesecon.register_node(name, spec_common, spec_off, spec_on) function mesecon.register_node(name, spec_common, spec_off, spec_on)
spec_common.drop = spec_common.drop or name .. "_off" spec_common.drop = spec_common.drop or name .. "_off"
spec_common.on_blast = spec_common.on_blast or mesecon.on_blastnode
spec_common.__mesecon_basename = name spec_common.__mesecon_basename = name
spec_on.__mesecon_state = "on" spec_on.__mesecon_state = "on"
spec_off.__mesecon_state = "off" spec_off.__mesecon_state = "off"