From 5537257185bd510828295b0c9d7da0e542e801ff Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Sun, 23 Jun 2013 19:52:01 -0400 Subject: [PATCH] Whoops, tubes ought to connect to deployers! --- compat.lua | 8 ++------ deployer.lua | 6 ++++-- node_breaker.lua | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/compat.lua b/compat.lua index 9caee89..6f555d0 100644 --- a/compat.lua +++ b/compat.lua @@ -88,10 +88,6 @@ chest.tube={insert_object=function(pos,node,stack,direction) return inv:room_for_item("main",stack) end, input_inventory="main"} -chest.after_place_node = function(pos) - tube_scanforobjects(pos) - end -chest.after_dig_node = function(pos) - tube_scanforobjects(pos) - end +chest.after_place_node = tube_scanforobjects(pos) +chest.after_dig_node = tube_scanforobjects minetest.register_node(":default:chest",chest) diff --git a/deployer.lua b/deployer.lua index 7622b52..0a1cb0a 100644 --- a/deployer.lua +++ b/deployer.lua @@ -106,13 +106,13 @@ minetest.register_node("pipeworks:deployer_off", { local inv = meta:get_inventory() inv:set_size("main", 3*3) end, - can_dig = function(pos,player) local meta = minetest.env:get_meta(pos); local inv = meta:get_inventory() return inv:is_empty("main") end, - + after_place_node = tube_scanforobjects, + after_dig_node = tube_scanforobjects, }) minetest.register_node("pipeworks:deployer_on", { @@ -152,4 +152,6 @@ minetest.register_node("pipeworks:deployer_on", { local inv = meta:get_inventory() return inv:is_empty("main") end, + after_place_node = tube_scanforobjects, + after_dig_node = tube_scanforobjects, }) diff --git a/node_breaker.lua b/node_breaker.lua index 105f431..cda2692 100644 --- a/node_breaker.lua +++ b/node_breaker.lua @@ -93,10 +93,8 @@ minetest.register_node("pipeworks:nodebreaker_off", { groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1}, mesecons= {effector={action_on=node_breaker_on, action_off=node_breaker_off}}, sounds = default.node_sound_stone_defaults(), - on_construct = function(pos) - local meta = minetest.env:get_meta(pos) - end, - + after_place_node = tube_scanforobjects, + after_dig_node = tube_scanforobjects, }) minetest.register_node("pipeworks:nodebreaker_on", { @@ -108,4 +106,6 @@ minetest.register_node("pipeworks:nodebreaker_on", { paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1,not_in_creative_inventory=1}, sounds = default.node_sound_stone_defaults(), + after_place_node = tube_scanforobjects, + after_dig_node = tube_scanforobjects, }) \ No newline at end of file -- 2.30.2