mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
Redstone: Add basic blastnode handling
This commit is contained in:
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)
|
||||
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_dignode(mesecon.on_dignode)
|
||||
|
||||
|
|
|
@ -248,6 +248,7 @@ end
|
|||
|
||||
function mesecon.register_node(name, spec_common, spec_off, spec_on)
|
||||
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_on.__mesecon_state = "on"
|
||||
spec_off.__mesecon_state = "off"
|
||||
|
|
Loading…
Reference in a new issue