From 43cb2588772df39f401e0a53e5cecd42fdc052ba Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 7 Feb 2013 08:30:15 -0800 Subject: Make ghoststone conductive. --- mesecons_random/init.lua | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'mesecons_random/init.lua') diff --git a/mesecons_random/init.lua b/mesecons_random/init.lua index 4fc2f6e..78c3825 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,10 +51,17 @@ 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"}) - end + 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" }} }) -- cgit v1.2.3 From fb45ee1d777a486eb973b9406b131223e9d9ab13 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 8 Feb 2013 16:49:27 -0800 Subject: Remove ghoststone shadow when active. --- mesecons_random/init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mesecons_random/init.lua') diff --git a/mesecons_random/init.lua b/mesecons_random/init.lua index 78c3825..16ffa3b 100644 --- a/mesecons_random/init.lua +++ b/mesecons_random/init.lua @@ -51,6 +51,7 @@ minetest.register_node("mesecons_random:ghoststone_active", { walkable = false, diggable = false, sunlight_propagates = true, + paramtype = "light", mesecons = {conductor = { state = mesecon.state.on, rules = { @@ -62,7 +63,14 @@ minetest.register_node("mesecons_random:ghoststone_active", { {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 }) -- cgit v1.2.3