Bunch of fixes
authorRealBadAngel <mk@realbadangel.pl>
Sun, 27 Jan 2013 09:15:39 +0000 (10:15 +0100)
committerRealBadAngel <mk@realbadangel.pl>
Sun, 27 Jan 2013 09:15:39 +0000 (10:15 +0100)
technic/technic/concrete.lua
technic/technic/constructor.lua
technic/technic/copper_chest.lua
technic/technic/depends.txt
technic/technic/electric_furnace.lua
technic/technic/gold_chest.lua
technic/technic/init.lua
technic/technic/iron_chest.lua
technic/technic/node_breaker.lua
technic/technic/ores.lua
technic/technic/silver_chest.lua

index 6d031d97e9af434b9fba8df94ef4db8983afaafe..2d68ca180fa6870906bb226f23b68d9027fecd48 100644 (file)
@@ -73,7 +73,7 @@ minetest.register_node("technic:concrete_post", {
        sounds = default.node_sound_stone_defaults(),
 })
 
-stairsplus.register_stair_and_slab_and_panel_and_micro("concrete", "technic:concrete",
+stairsplus.register_stair_and_slab_and_panel_and_micro(":stairsplus", "concrete", "technic:concrete",
                {cracky=3},
                {"technic_concrete_block.png"},
                "Concrete Stairs",
index 1e584083cd55e45c9acc5d4383bd87014267ab64..b5a61cb724d973b2612b4cbe00acf2480715b8f5 100644 (file)
@@ -19,45 +19,7 @@ minetest.register_craft({
 
 })
 
-minetest.register_node("technic:constructor_mk1_off", {
-       description = "Constructor MK1",
-       tile_images = {"technic_constructor_mk1_top_off.png","technic_constructor_mk1_bottom_off.png","technic_constructor_mk1_side2_off.png","technic_constructor_mk1_side1_off.png",
-                       "technic_constructor_back.png","technic_constructor_front_off.png"},
-       is_ground_content = true,
-       paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2},
-       sounds = default.node_sound_stone_defaults(),
-       on_construct = function(pos)
-       local meta = minetest.env:get_meta(pos)
-       meta:set_string("formspec",
-                               "invsize[8,9;]"..
-                               "label[0,0;Constructor MK1]"..
-                               "label[5,0;Slot 1]"..
-                               "list[current_name;slot1;6,0;1,1;]"..
-                               "list[current_player;main;0,5;8,4;]")
-               meta:set_string("infotext", "Constructor MK1")
-               local inv = meta:get_inventory()
-               inv:set_size("slot1", 1)
-       end,
-
-       can_dig = function(pos,player)
-               local meta = minetest.env:get_meta(pos)
-               local inv = meta:get_inventory()
-               return inv:is_empty("slot1")
-       end,    
-})
-
-minetest.register_node("technic:constructor_mk1_on", {
-       description = "Constructor MK1",
-       tile_images = {"technic_constructor_mk1_top_on.png","technic_constructor_mk1_bottom_on.png","technic_constructor_mk1_side2_on.png","technic_constructor_mk1_side1_on.png",
-                       "technic_constructor_back.png","technic_constructor_front_on.png"},
-       is_ground_content = true,
-       paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2,not_in_creative_inventory=1},
-       sounds = default.node_sound_stone_defaults(),
-})
-
-mesecon:register_on_signal_on(function(pos, node)
+mk1_on = function(pos, node)
        local meta = minetest.env:get_meta(pos)
        local inv = meta:get_inventory()
        local pos1={}
@@ -75,61 +37,60 @@ mesecon:register_on_signal_on(function(pos, node)
                local node1=minetest.env:get_node(pos1)
                deploy_node (inv,"slot1",pos1,node1,node)
        end
+end
 
-end)
-
-mesecon:register_on_signal_off(function(pos, node)
+mk1_off = function(pos, node)
        if node.name == "technic:constructor_mk1_on" then
                hacky_swap_node(pos,"technic:constructor_mk1_off")
                nodeupdate(pos)
        end
-end)
+end
 
-mesecon:register_effector("technic:constructor_mk1_on", "technic:constructor_mk1_off")
 
-minetest.register_node("technic:constructor_mk2_off", {
-       description = "Constructor MK2",
-       tile_images = {"technic_constructor_mk2_top_off.png","technic_constructor_mk2_bottom_off.png","technic_constructor_mk2_side2_off.png","technic_constructor_mk2_side1_off.png",
+minetest.register_node("technic:constructor_mk1_off", {
+       description = "Constructor MK1",
+       tile_images = {"technic_constructor_mk1_top_off.png","technic_constructor_mk1_bottom_off.png","technic_constructor_mk1_side2_off.png","technic_constructor_mk1_side1_off.png",
                        "technic_constructor_back.png","technic_constructor_front_off.png"},
        is_ground_content = true,
        paramtype2 = "facedir",
        groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2},
+       mesecons= {effector={action_on=mk1_on}},
        sounds = default.node_sound_stone_defaults(),
        on_construct = function(pos)
        local meta = minetest.env:get_meta(pos)
        meta:set_string("formspec",
                                "invsize[8,9;]"..
-                               "label[0,0;Constructor MK2]"..
+                               "label[0,0;Constructor MK1]"..
                                "label[5,0;Slot 1]"..
                                "list[current_name;slot1;6,0;1,1;]"..
-                               "label[5,1;Slot 2]"..
-                               "list[current_name;slot2;6,1;1,1;]"..
                                "list[current_player;main;0,5;8,4;]")
-               meta:set_string("infotext", "Constructor MK2")
+               meta:set_string("infotext", "Constructor MK1")
                local inv = meta:get_inventory()
                inv:set_size("slot1", 1)
-               inv:set_size("slot2", 1)
        end,
 
        can_dig = function(pos,player)
                local meta = minetest.env:get_meta(pos)
                local inv = meta:get_inventory()
-               if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false then return false end
-               return true
+               return inv:is_empty("slot1")
        end,    
 })
 
-minetest.register_node("technic:constructor_mk2_on", {
-       description = "Constructor MK2",
-       tile_images = {"technic_constructor_mk2_top_on.png","technic_constructor_mk2_bottom_on.png","technic_constructor_mk2_side2_on.png","technic_constructor_mk2_side1_on.png",
+minetest.register_node("technic:constructor_mk1_on", {
+       description = "Constructor MK1",
+       tile_images = {"technic_constructor_mk1_top_on.png","technic_constructor_mk1_bottom_on.png","technic_constructor_mk1_side2_on.png","technic_constructor_mk1_side1_on.png",
                        "technic_constructor_back.png","technic_constructor_front_on.png"},
        is_ground_content = true,
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2,not_in_creative_inventory=1},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,mesecon = 2,not_in_creative_inventory=1},
+       mesecons= {effector={action_off=mk1_off}},
        sounds = default.node_sound_stone_defaults(),
 })
 
-mesecon:register_on_signal_on(function(pos, node)
+
+--Constructor MK2
+
+mk2_on = function(pos, node)
        local meta = minetest.env:get_meta(pos)
        local inv = meta:get_inventory()
        local pos1={}
@@ -153,26 +114,23 @@ mesecon:register_on_signal_on(function(pos, node)
                local node1=minetest.env:get_node(pos2) 
                deploy_node (inv,"slot2",pos2,node1,node)
        end
+end
 
-end)
-
-
-mesecon:register_on_signal_off(function(pos, node)
+mk2_off = function(pos, node)
        if node.name == "technic:constructor_mk2_on" then
                hacky_swap_node(pos,"technic:constructor_mk2_off")
                nodeupdate(pos)
        end
-end)
-
-mesecon:register_effector("technic:constructor_mk2_on", "technic:constructor_mk2_off")
+end
 
-minetest.register_node("technic:constructor_mk3_off", {
-       description = "Constructor MK3",
-       tile_images = {"technic_constructor_mk3_top_off.png","technic_constructor_mk3_bottom_off.png","technic_constructor_mk3_side2_off.png","technic_constructor_mk3_side1_off.png",
+minetest.register_node("technic:constructor_mk2_off", {
+       description = "Constructor MK2",
+       tile_images = {"technic_constructor_mk2_top_off.png","technic_constructor_mk2_bottom_off.png","technic_constructor_mk2_side2_off.png","technic_constructor_mk2_side1_off.png",
                        "technic_constructor_back.png","technic_constructor_front_off.png"},
        is_ground_content = true,
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2},
+       mesecons= {effector={action_on=mk2_on}},
        sounds = default.node_sound_stone_defaults(),
        on_construct = function(pos)
        local meta = minetest.env:get_meta(pos)
@@ -183,39 +141,35 @@ minetest.register_node("technic:constructor_mk3_off", {
                                "list[current_name;slot1;6,0;1,1;]"..
                                "label[5,1;Slot 2]"..
                                "list[current_name;slot2;6,1;1,1;]"..
-                               "label[5,2;Slot 3]"..
-                               "list[current_name;slot3;6,2;1,1;]"..
-                               "label[5,3;Slot 4]"..
-                               "list[current_name;slot4;6,3;1,1;]"..
                                "list[current_player;main;0,5;8,4;]")
-               meta:set_string("infotext", "Constructor MK3")
+               meta:set_string("infotext", "Constructor MK2")
                local inv = meta:get_inventory()
                inv:set_size("slot1", 1)
                inv:set_size("slot2", 1)
-               inv:set_size("slot3", 1)
-               inv:set_size("slot4", 1)
-
        end,
 
        can_dig = function(pos,player)
                local meta = minetest.env:get_meta(pos)
                local inv = meta:get_inventory()
-               if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false or inv:is_empty("slot3")==false or inv:is_empty("slot4")==false then return false end
+               if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false then return false end
                return true
        end,    
 })
 
-minetest.register_node("technic:constructor_mk3_on", {
-       description = "Constructor MK3",
-       tile_images = {"technic_constructor_mk3_top_on.png","technic_constructor_mk3_bottom_on.png","technic_constructor_mk3_side2_on.png","technic_constructor_mk3_side1_on.png",
+minetest.register_node("technic:constructor_mk2_on", {
+       description = "Constructor MK2",
+       tile_images = {"technic_constructor_mk2_top_on.png","technic_constructor_mk2_bottom_on.png","technic_constructor_mk2_side2_on.png","technic_constructor_mk2_side1_on.png",
                        "technic_constructor_back.png","technic_constructor_front_on.png"},
        is_ground_content = true,
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2,not_in_creative_inventory=1},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2, not_in_creative_inventory=1},
+       mesecons= {effector={action_off=mk2_off}},
        sounds = default.node_sound_stone_defaults(),
 })
 
-mesecon:register_on_signal_on(function(pos, node)
+
+-- Constructor MK3
+mk3_on = function(pos, node)
        local meta = minetest.env:get_meta(pos)
        local inv = meta:get_inventory()
        
@@ -257,18 +211,65 @@ mesecon:register_on_signal_on(function(pos, node)
                local node1=minetest.env:get_node(pos4) 
                deploy_node (inv,"slot4",pos4,node1,node)
        end
+end
 
-end)
-
-
-mesecon:register_on_signal_off(function(pos, node)
+mk3_off = function(pos, node)
        if node.name == "technic:constructor_mk3_on" then
                hacky_swap_node(pos,"technic:constructor_mk3_off")
                nodeupdate(pos)
        end
-end)
+end
 
-mesecon:register_effector("technic:constructor_mk3_on", "technic:constructor_mk3_off")
+minetest.register_node("technic:constructor_mk3_off", {
+       description = "Constructor MK3",
+       tile_images = {"technic_constructor_mk3_top_off.png","technic_constructor_mk3_bottom_off.png","technic_constructor_mk3_side2_off.png","technic_constructor_mk3_side1_off.png",
+                       "technic_constructor_back.png","technic_constructor_front_off.png"},
+       is_ground_content = true,
+       paramtype2 = "facedir",
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2},
+       mesecons= {effector={action_on=mk3_on}},
+       sounds = default.node_sound_stone_defaults(),
+       on_construct = function(pos)
+       local meta = minetest.env:get_meta(pos)
+       meta:set_string("formspec",
+                               "invsize[8,9;]"..
+                               "label[0,0;Constructor MK2]"..
+                               "label[5,0;Slot 1]"..
+                               "list[current_name;slot1;6,0;1,1;]"..
+                               "label[5,1;Slot 2]"..
+                               "list[current_name;slot2;6,1;1,1;]"..
+                               "label[5,2;Slot 3]"..
+                               "list[current_name;slot3;6,2;1,1;]"..
+                               "label[5,3;Slot 4]"..
+                               "list[current_name;slot4;6,3;1,1;]"..
+                               "list[current_player;main;0,5;8,4;]")
+               meta:set_string("infotext", "Constructor MK3")
+               local inv = meta:get_inventory()
+               inv:set_size("slot1", 1)
+               inv:set_size("slot2", 1)
+               inv:set_size("slot3", 1)
+               inv:set_size("slot4", 1)
+
+       end,
+
+       can_dig = function(pos,player)
+               local meta = minetest.env:get_meta(pos)
+               local inv = meta:get_inventory()
+               if inv:is_empty("slot1")==false or inv:is_empty("slot2")==false or inv:is_empty("slot3")==false or inv:is_empty("slot4")==false then return false end
+               return true
+       end,    
+})
+
+minetest.register_node("technic:constructor_mk3_on", {
+       description = "Constructor MK3",
+       tile_images = {"technic_constructor_mk3_top_on.png","technic_constructor_mk3_bottom_on.png","technic_constructor_mk3_side2_on.png","technic_constructor_mk3_side1_on.png",
+                       "technic_constructor_back.png","technic_constructor_front_on.png"},
+       is_ground_content = true,
+       paramtype2 = "facedir",
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,not_in_creative_inventory=1},
+       mesecons= {effector={action_off=mk3_off}},
+       sounds = default.node_sound_stone_defaults(),
+})
 
 
 deploy_node =function (inv, slot_name, pos1, node1, node)
@@ -294,4 +295,4 @@ if node1.name == "air" then
                        minetest.env:remove_node(pos1)
                end
 
-end
\ No newline at end of file
+end
index cf1ae06c587ab10d090414decf410aa63338832f..5fba6a65457cf06fdc2f8a77099138b9d008c9c7 100644 (file)
@@ -38,7 +38,18 @@ minetest.register_node("technic:copper_chest", {
        tiles = {"technic_copper_chest_top.png", "technic_copper_chest_top.png", "technic_copper_chest_side.png",
                "technic_copper_chest_side.png", "technic_copper_chest_side.png", "technic_copper_chest_front.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        on_construct = function(pos)
@@ -89,7 +100,18 @@ minetest.register_node("technic:copper_locked_chest", {
        tiles = {"technic_copper_chest_top.png", "technic_copper_chest_top.png", "technic_copper_chest_side.png",
                "technic_copper_chest_side.png", "technic_copper_chest_side.png", "technic_copper_chest_locked.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        after_place_node = function(pos, placer)
index 8f4edab766e5b667f56fa87b66848606aad5f8d6..492d75e8e182530c2e3def8092f9204e0f33b8ca 100644 (file)
@@ -1,5 +1,4 @@
 moreores
-flowers
 pipeworks
 mesecons
 stairsplus
index ab56bdb583b7b44484970731221650cc31f741a5..135880227608b7f1fd50df8d49128150f2c65a96 100644 (file)
@@ -107,7 +107,6 @@ minetest.register_abm({
                local load = math.floor(internal_EU_buffer/2000 * 100)
                meta:set_string("formspec",
                                "invsize[8,9;]"..
-                               "background[-1,-1;10,11;technic_electric_furnace_GUI.png]"..
                                "image[1,1;1,2;technic_power_meter_bg.png^[lowpart:"..
                                        (load)..":technic_power_meter_fg.png]"..
                                "list[current_name;src;3,1;1,1;]"..
index 29f16667809b3f8c57770c163cae0e3d51591b05..4fd5316ae4a881e7dbd830f37a2b4e722b72ebf0 100644 (file)
@@ -57,6 +57,17 @@ minetest.register_node("technic:gold_chest", {
                "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front.png"},
        paramtype2 = "facedir",
        groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        on_construct = function(pos)
@@ -117,7 +128,18 @@ minetest.register_node("technic:gold_chest".. state, {
        tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
                "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front"..state..".png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, not_in_creative_inventory=1,tubedevice=1,tubedevice_receiver=1},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        drop = "technic:gold_chest",
@@ -189,6 +211,17 @@ minetest.register_node("technic:gold_locked_chest", {
        paramtype2 = "facedir",
        drop = "technic:gold_locked_chest",
        groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        after_place_node = function(pos, placer)
@@ -287,7 +320,18 @@ minetest.register_node("technic:gold_locked_chest".. state, {
                "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_locked"..state..".png"},
        paramtype2 = "facedir",
        drop = "technic:gold_locked_chest",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, not_in_creative_inventory=1,tubedevice=1,tubedevice_receiver=1},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        after_place_node = function(pos, placer)
@@ -608,4 +652,4 @@ function locked_chest_punched (pos,node,puncher)
                local meta = minetest.env:get_meta(pos);
                 meta:set_string("formspec", "hack:sign_text_input")
        end
-       
\ No newline at end of file
+       
index fd359ba48f968ba38c3e854332a73ecf87f26b5d..14564629499ab4e626a6d7449162b65ac399a4e9 100644 (file)
@@ -1,20 +1,5 @@
 -- Minetest 0.4.4 : technic
 
-minetest.register_alias("rebar", "technic:rebar")
-minetest.register_alias("concrete", "technic:concrete")
-minetest.register_alias("concrete_post", "technic:concrete_post")
-minetest.register_alias("iron_chest", "technic:iron_chest")
-minetest.register_alias("iron_locked_chest", "technic:iron_locked_chest")
-minetest.register_alias("copper_chest", "technic:copper_chest")
-minetest.register_alias("copper_locked_chest", "technic:copper_locked_chest")
-minetest.register_alias("silver_chest", "technic:silver_chest")
-minetest.register_alias("silver_locked_chest", "technic:silver_locked_chest")
-minetest.register_alias("gold_chest", "technic:gold_chest")
-minetest.register_alias("gold_locked_chest", "technic:gold_locked_chest")
-minetest.register_alias("mithril_chest", "technic:mithril_chest")
-minetest.register_alias("mithril_locked_chest", "technic:mithril_locked_chest")
-
-
 modpath=minetest.get_modpath("technic")
 
 --Read technic config file
@@ -64,9 +49,9 @@ dofile(modpath.."/screwdriver.lua")
 dofile(modpath.."/sonic_screwdriver.lua")
 
 -- mesecons and tubes related
-dofile(modpath.."/injector.lua")
+--dofile(modpath.."/injector.lua")
 dofile(modpath.."/node_breaker.lua")
-dofile(modpath.."/deployer.lua")
+--dofile(modpath.."/deployer.lua")
 dofile(modpath.."/constructor.lua")
 
 if enable_item_drop    then dofile(modpath.."/item_drop.lua") end
index 27b1aba1b0df80df75831ee884f83b2b4d523b69..36105d1c6d42ea206d4eae7a75ed75c1857bc563 100644 (file)
@@ -41,7 +41,18 @@ minetest.register_node("technic:iron_chest", {
        tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
                "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_front.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        on_construct = function(pos)
@@ -90,7 +101,18 @@ minetest.register_node("technic:iron_locked_chest", {
        tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
                "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_locked.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        after_place_node = function(pos, placer)
index 3a7f53b7f203330c52eae31a016d6abde5685e00..06de700f37cd858b77900450e4e648d76476d0d8 100644 (file)
@@ -8,13 +8,29 @@ minetest.register_craft({
        }
 })
 
+node_breaker_on = function(pos, node)
+       if node.name == "technic:nodebreaker_off" then
+               hacky_swap_node(pos,"technic:nodebreaker_on")
+               break_node (pos,node.param2)
+               nodeupdate(pos)
+       end
+end
+
+node_breaker_off = function(pos, node)
+       if node.name == "technic:nodebreaker_on" then
+               hacky_swap_node(pos,"technic:nodebreaker_off")
+               nodeupdate(pos)
+       end
+end
+
 minetest.register_node("technic:nodebreaker_off", {
        description = "Node Breaker",
        tile_images = {"technic_nodebreaker_top_off.png","technic_nodebreaker_bottom_off.png","technic_nodebreaker_side2_off.png","technic_nodebreaker_side1_off.png",
                        "technic_nodebreaker_back.png","technic_nodebreaker_front_off.png"},
        is_ground_content = true,
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2,tubedevice=1},
+       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)
@@ -26,29 +42,13 @@ minetest.register_node("technic:nodebreaker_on", {
        description = "Node Breaker",
        tile_images = {"technic_nodebreaker_top_on.png","technic_nodebreaker_bottom_on.png","technic_nodebreaker_side2_on.png","technic_nodebreaker_side1_on.png",
                        "technic_nodebreaker_back.png","technic_nodebreaker_front_on.png"},
+       mesecons= {effector={action_on=node_breaker_on, action_off=node_breaker_off}},
        is_ground_content = true,
        paramtype2 = "facedir",
-       tubelike=1,
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon_receptor_off = 1, mesecon_effector_off = 1, mesecon = 2,tubedevice=1,not_in_creative_inventory=1},
+       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(),
 })
 
-mesecon:register_on_signal_on(function(pos, node)
-       if node.name == "technic:nodebreaker_off" then
-               minetest.env:add_node(pos, {name="technic:nodebreaker_on", param2 = node.param2})
-               break_node (pos,node.param2)
-               nodeupdate(pos)
-       end
-end)
-
-mesecon:register_on_signal_off(function(pos, node)
-       if node.name == "technic:nodebreaker_on" then
-               minetest.env:add_node(pos, {name="technic:nodebreaker_off", param2 = node.param2})
-               nodeupdate(pos)
-       end
-end)
-
-mesecon:register_effector("technic:nodebreaker_on", "technic:nodebreaker_off")
 
 function break_node (pos,n_param)              
        local pos1={}
@@ -70,9 +70,6 @@ function break_node (pos,n_param)
        if n_param==0 then pos2.z=pos2.z-1 pos1.x=pos1.z+1 z_velocity=1 end
 
        local node=minetest.env:get_node(pos2)
-       local meta = minetest.env:get_meta(pos1)
-       tubelike=meta:get_int("tubelike")
-       --if tubelike==1 then
        if node.name == "air" then return nil end
        if node.name == "default:lava_source" then return nil end
        if node.name == "default:lava_flowing" then return nil end
@@ -86,9 +83,7 @@ function break_node (pos,n_param)
                        item1:get_luaentity().start_pos = {x=pos.x,y=pos.y,z=pos.z}
                        item1:setvelocity({x=x_velocity, y=0, z=z_velocity})
                        item1:setacceleration({x=0, y=0, z=0})
---                     minetest.item_drop(dropped_item, "", pos1)
                end
        minetest.env:remove_node(pos2)
-       --end
 end
 
index 2642c9e2d17fd7fe96590ff895afcb5338a5e8ae..fddfc5e0e7ff6e46400d464f5b7ecb741169d69d 100644 (file)
@@ -38,7 +38,7 @@ minetest.register_node( "technic:obsidian", {
        sounds = default.node_sound_stone_defaults(),
 }) 
 
-stairsplus.register_stair_and_slab_and_panel_and_micro("marble", "technic:marble",
+stairsplus.register_stair_and_slab_and_panel_and_micro(":stairsplus", "marble", "technic:marble",
                {cracky=3},
                {"technic_marble.png"},
                "Marble Stairs",
@@ -46,7 +46,7 @@ stairsplus.register_stair_and_slab_and_panel_and_micro("marble", "technic:marble
                "Marble Panel",
                "Marble Microblock",
                "marble")
-stairsplus.register_stair_and_slab_and_panel_and_micro("marble_bricks", "technic:marble_bricks",
+stairsplus.register_stair_and_slab_and_panel_and_micro(":stairsplus", "marble_bricks", "technic:marble_bricks",
                {cracky=3},
                {"technic_marble_bricks.png"},
                "Marble Bricks Stairs",
@@ -54,7 +54,7 @@ stairsplus.register_stair_and_slab_and_panel_and_micro("marble_bricks", "technic
                "Marble Bricks Panel",
                "Marble Bricks Microblock",
                "marble_bricks")
-stairsplus.register_stair_and_slab_and_panel_and_micro("granite", "technic:granite",
+stairsplus.register_stair_and_slab_and_panel_and_micro(":stairsplus", "granite", "technic:granite",
                {cracky=3},
                {"technic_granite.png"},
                "Granite Stairs",
@@ -62,7 +62,7 @@ stairsplus.register_stair_and_slab_and_panel_and_micro("granite", "technic:grani
                "Granite Panel",
                "Granite Microblock",
                "granite")
-stairsplus.register_stair_and_slab_and_panel_and_micro("obsidian", "technic:obsidian",
+stairsplus.register_stair_and_slab_and_panel_and_micro(":stairsplus", "obsidian", "technic:obsidian",
                {cracky=3},
                {"technic_obsidian.png"},
                "Obsidian Stairs",
@@ -336,4 +336,4 @@ function generate_stratus(name, wherein, ceilin, ceil, minp, maxp, seed, stratus
     end
   end
   --print("generate_ore done")
-end
\ No newline at end of file
+end
index 66a915ac3510221d965138115871cff1913523e9..85df64c2739fdf493278c02ac8879bf1c85794c0 100644 (file)
@@ -38,7 +38,18 @@ minetest.register_node("technic:silver_chest", {
        tiles = {"technic_silver_chest_top.png", "technic_silver_chest_top.png", "technic_silver_chest_side.png",
                "technic_silver_chest_side.png", "technic_silver_chest_side.png", "technic_silver_chest_front.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},
        legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        on_construct = function(pos)
@@ -106,8 +117,18 @@ minetest.register_node("technic:silver_locked_chest", {
        tiles = {"technic_silver_chest_top.png", "technic_silver_chest_top.png", "technic_silver_chest_side.png",
                "technic_silver_chest_side.png", "technic_silver_chest_side.png", "technic_silver_chest_locked.png"},
        paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
-       legacy_facedir_simple = true,
+       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
+       tube={insert_object=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:add_item("main",stack)
+               end,
+               can_insert=function(pos,node,stack,direction)
+                       local meta=minetest.env:get_meta(pos)
+                       local inv=meta:get_inventory()
+                       return inv:room_for_item("main",stack)
+               end,
+               input_inventory="main"},legacy_facedir_simple = true,
        sounds = default.node_sound_wood_defaults(),
        after_place_node = function(pos, placer)
                local meta = minetest.env:get_meta(pos)