From b7b6f356facdb15770cff6afd4f8b5cac1562228 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 30 Jan 2018 06:01:36 +0100 Subject: [PATCH] Redstone: Add basic blastnode handling --- mods/ITEMS/REDSTONE/mesecons/services.lua | 7 +++++++ mods/ITEMS/REDSTONE/mesecons/util.lua | 1 + 2 files changed, 8 insertions(+) diff --git a/mods/ITEMS/REDSTONE/mesecons/services.lua b/mods/ITEMS/REDSTONE/mesecons/services.lua index 6ea036aa..9addda8b 100644 --- a/mods/ITEMS/REDSTONE/mesecons/services.lua +++ b/mods/ITEMS/REDSTONE/mesecons/services.lua @@ -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) diff --git a/mods/ITEMS/REDSTONE/mesecons/util.lua b/mods/ITEMS/REDSTONE/mesecons/util.lua index 7fd1f6fd..91da1e95 100644 --- a/mods/ITEMS/REDSTONE/mesecons/util.lua +++ b/mods/ITEMS/REDSTONE/mesecons/util.lua @@ -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"