diff options
author | Jeija <norrepli@gmail.com> | 2013-02-11 08:03:08 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2013-02-11 08:03:08 +0100 |
commit | 10ea3c971b21cd2232a542d330280007fa743fc4 (patch) | |
tree | 4f2a87666ee41be3dee68c001e47682ba6f5287e /mesecons_random | |
parent | 591e2d7cde9eda88ca85b71066dd9ed7f75f9a12 (diff) | |
parent | 7cc803b0d7ed3ff4f1b57d78b9523919a9fcd924 (diff) | |
download | mesecons-10ea3c971b21cd2232a542d330280007fa743fc4.tar mesecons-10ea3c971b21cd2232a542d330280007fa743fc4.tar.gz mesecons-10ea3c971b21cd2232a542d330280007fa743fc4.tar.bz2 mesecons-10ea3c971b21cd2232a542d330280007fa743fc4.tar.xz mesecons-10ea3c971b21cd2232a542d330280007fa743fc4.zip |
Merge branch 'master' into luacontroller
Diffstat (limited to 'mesecons_random')
-rw-r--r-- | mesecons_random/init.lua | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/mesecons_random/init.lua b/mesecons_random/init.lua index 4fc2f6e..16ffa3b 100644 --- a/mesecons_random/init.lua +++ b/mesecons_random/init.lua @@ -31,10 +31,17 @@ minetest.register_node("mesecons_random:ghoststone", { inventory_image = minetest.inventorycube("jeija_ghoststone_inv.png"), groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), - mesecons = {effector = { - action_on = function (pos, node) - minetest.env:add_node(pos, {name="mesecons_random:ghoststone_active"}) - end + mesecons = {conductor = { + state = mesecon.state.off, + rules = { --axes + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + onstate = "mesecons_random:ghoststone_active" }} }) @@ -44,11 +51,26 @@ minetest.register_node("mesecons_random:ghoststone_active", { walkable = false, diggable = false, sunlight_propagates = true, - mesecons = {effector = { - action_off = function (pos, node) - minetest.env:add_node(pos, {name="mesecons_random:ghoststone"}) + paramtype = "light", + mesecons = {conductor = { + state = mesecon.state.on, + rules = { + {x = -1, y = 0, z = 0}, + {x = 1, y = 0, z = 0}, + {x = 0, y = -1, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, + }, + offstate = "mesecons_random:ghoststone" + }}, + on_construct = function(pos) + --remove shadow + pos2 = {x = pos.x, y = pos.y + 1, z = pos.z} + if ( minetest.env:get_node(pos2).name == "air" ) then + minetest.env:dig_node(pos2) end - }} + end }) |