Better deployer and node breaker mesecons rules.
authorNovatux <nathanael.courant@laposte.net>
Sun, 6 Oct 2013 08:35:53 +0000 (10:35 +0200)
committerNovatux <nathanael.courant@laposte.net>
Sun, 6 Oct 2013 08:35:53 +0000 (10:35 +0200)
deployer.lua
init.lua
node_breaker.lua

index 1e8ae170c122fd67f81ae2e2a043f879f086f0cc..c6213aa1ea717ca328e15d08bd2df08019d7714d 100644 (file)
@@ -143,7 +143,7 @@ minetest.register_node("pipeworks:deployer_off", {
        description = "Deployer",
        tile_images = {"pipeworks_deployer_top.png","pipeworks_deployer_bottom.png","pipeworks_deployer_side2.png","pipeworks_deployer_side1.png",
                        "pipeworks_deployer_back.png","pipeworks_deployer_front_off.png"},
-       mesecons = {effector={action_on=deployer_on,action_off=deployer_off}},
+       mesecons = {effector={rules=rules_all,action_on=deployer_on,action_off=deployer_off}},
        tube={insert_object=function(pos,node,stack,direction)
                        local meta=minetest.get_meta(pos)
                        local inv=meta:get_inventory()
@@ -203,7 +203,7 @@ minetest.register_node("pipeworks:deployer_on", {
        description = "Deployer",
        tile_images = {"pipeworks_deployer_top.png","pipeworks_deployer_bottom.png","pipeworks_deployer_side2.png","pipeworks_deployer_side1.png",
                        "pipeworks_deployer_back.png","pipeworks_deployer_front_on.png"},
-       mesecons = {effector={action_on=deployer_on,action_off=deployer_off}},
+       mesecons = {effector={rules=rules_all,action_on=deployer_on,action_off=deployer_off}},
        tube={insert_object=function(pos,node,stack,direction)
                        local meta=minetest.get_meta(pos)
                        local inv=meta:get_inventory()
index 306f64c07dc4551ea5472f7e2d3107e5326d152f..b2063375ddd6dee8fd44f0e11997e37dbf7e5815 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -111,6 +111,10 @@ dofile(modpath.."/crafts.lua")
 
 dofile(modpath.."/tubes.lua")
 
+rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y=0, z=0},
+               {x=0, y=1, z=1},{x=0, y=1, z=-1},{x=1, y=1, z=0},{x=-1, y=1, z=0},
+               {x=0, y=-1, z=1},{x=0, y=-1, z=-1},{x=1, y=-1, z=0},{x=-1, y=-1, z=0},
+               {x=0, y=1, z=0}, {x=0, y=-1, z=0}}
 if enable_pipes then dofile(modpath.."/pipes.lua") end
 if enable_teleport_tube then dofile(modpath.."/teleport_tube.lua") end
 if enable_pipe_devices then dofile(modpath.."/devices.lua") end
index 5ed7f86e09200916318a92977b8527fee0fe6e66..9cb9091fc73d53d1e9db2aeded8db783d988dff1 100644 (file)
@@ -179,7 +179,7 @@ minetest.register_node("pipeworks:nodebreaker_off", {
        is_ground_content = true,
        paramtype2 = "facedir",
        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}},
+       mesecons= {effector={rules=rules_all,action_on=node_breaker_on, action_off=node_breaker_off}},
        sounds = default.node_sound_stone_defaults(),
        tube = {connect_sides={back=1}},
        after_place_node = function (pos, placer)
@@ -209,7 +209,7 @@ minetest.register_node("pipeworks:nodebreaker_on", {
        description = "Node Breaker",
        tile_images = {"pipeworks_nodebreaker_top_on.png","pipeworks_nodebreaker_bottom_on.png","pipeworks_nodebreaker_side2_on.png","pipeworks_nodebreaker_side1_on.png",
                        "pipeworks_nodebreaker_back.png","pipeworks_nodebreaker_front_on.png"},
-       mesecons= {effector={action_on=node_breaker_on, action_off=node_breaker_off}},
+       mesecons= {effector={rules=rules_all,action_on=node_breaker_on, action_off=node_breaker_off}},
        is_ground_content = true,
        paramtype2 = "facedir",
        groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1,not_in_creative_inventory=1},