From 2cc44e36a4bfe733913c8e201caf55dfcabcc2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 26 Aug 2016 13:00:00 +0200 Subject: Now automatically removes bones from elevator shaft --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index f15094c..fc6920f 100644 --- a/init.lua +++ b/init.lua @@ -52,7 +52,7 @@ local function fetch_lift(pos, node, clicker, rel, i, open_door, plus) else if wnode.name == "lifter:lift" then local name = minetest.get_node({x=pos.x+1, y=pos.y+rel, z=pos.z}).name - if name == "air" or name == "ignore" then + if name == "air" or name == "ignore" or name == "bones:bones" then minetest.remove_node({x=pos.x+1, y=pos.y+i, z=pos.z}) minetest.add_node({x=pos.x+1, y=pos.y+rel, z=pos.z}, {name="lifter:lift"}) else @@ -61,7 +61,7 @@ local function fetch_lift(pos, node, clicker, rel, i, open_door, plus) end if snode.name == "lifter:lift" then local name = minetest.get_node({x=pos.x-1, y=pos.y+rel, z=pos.z}).name - if name == "air" or name == "ignore" then + if name == "air" or name == "ignore" or name == "bones:bones" then minetest.remove_node({x=pos.x-1, y=pos.y+i, z=pos.z}) minetest.add_node({x=pos.x-1, y=pos.y+rel, z=pos.z}, {name="lifter:lift"}) else @@ -70,7 +70,7 @@ local function fetch_lift(pos, node, clicker, rel, i, open_door, plus) end if anode.name == "lifter:lift" then local name = minetest.get_node({x=pos.x, y=pos.y+rel, z=pos.z+1}).name - if name == "air" or name == "ignore" then + if name == "air" or name == "ignore" or name == "bones:bones" then minetest.remove_node({x=pos.x, y=pos.y+i, z=pos.z+1}) minetest.add_node({x=pos.x, y=pos.y+rel, z=pos.z+1}, {name="lifter:lift"}) else @@ -79,7 +79,7 @@ local function fetch_lift(pos, node, clicker, rel, i, open_door, plus) end if dnode.name == "lifter:lift" then local name = minetest.get_node({x=pos.x, y=pos.y+rel, z=pos.z-1}).name - if name == "air" or name == "ignore" then + if name == "air" or name == "ignore" or name == "bones:bones" then minetest.remove_node({x=pos.x, y=pos.y+i, z=pos.z-1}) minetest.add_node({x=pos.x, y=pos.y+rel, z=pos.z-1}, {name="lifter:lift"}) else -- cgit v1.2.3 From 6eb3d8ee64f834dab77a2314342d7b0eaa2e8efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 26 Aug 2016 23:53:14 +0200 Subject: Lift deletes bones now --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index fc6920f..934810e 100644 --- a/init.lua +++ b/init.lua @@ -33,7 +33,9 @@ local function fetch_lift(pos, node, clicker, rel, i, open_door, plus) anode.name ~= "lifter:lift" and dnode.name ~= "lifter:lift" then if wnode.name ~= "air" and snode.name ~= "air" and - anode.name ~= "air" and dnode.name ~= "air" then + anode.name ~= "air" and dnode.name ~= "air" and + wnode.name ~= "bones:bones" and snode.name ~= "bones:bones" and + anode.name ~= "bones:bones" and dnode.name ~= "bones:bones"then print("lift not found, no air") return end -- cgit v1.2.3 From faf864d11b74f5d7e7d44ec6dab4609c5619c234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Thu, 6 Oct 2016 12:37:39 +0200 Subject: Doors now close automatically --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index 934810e..ae32d67 100644 --- a/init.lua +++ b/init.lua @@ -103,12 +103,23 @@ minetest.override_item("lifter:door_a", { end fetch_lift(pos, node, clicker, -1, 0, b1rc, 1) fetch_lift(pos, node, clicker, -1, 0, b1rc, -1) +-- minetest.after(5, b1rc, pos, node, clicker) else b1rc(pos, node, player) end end }) +minetest.register_abm({ + nodenames = {"lifter:door_b"}, + interval = 8, + chance = 1, + catch_up = false, + action = function(pos, node) + minetest.after(1, b1rc, pos, node, "") + end +}) + --minetest.override_item("lifter:door_b_2", { --on_rightclick = hijack_click(b2rc) --}) -- cgit v1.2.3