From 434ae78be3f11b546649043993b70608eea8a8ae Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 23 Feb 2021 21:48:45 +0100 Subject: [PATCH] Improve doorcontroller2 to be able to exchange nodes --- logic/doorblock.lua | 3 ++- logic/doorcontroller2.lua | 3 ++- logic/gateblock.lua | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/logic/doorblock.lua b/logic/doorblock.lua index db72f09..3f7bd15 100644 --- a/logic/doorblock.lua +++ b/logic/doorblock.lua @@ -90,7 +90,8 @@ for idx,pgn in ipairs(tPgns) do use_texture_alpha = true, sunlight_propagates = true, sounds = default.node_sound_stone_defaults(), - groups = {cracky=2, choppy=2, crumbly=2, not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, + groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, + not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, is_ground_content = false, drop = "techage:doorblock"..NUM_TEXTURES, }, diff --git a/logic/doorcontroller2.lua b/logic/doorcontroller2.lua index e5b5988..d846a5a 100644 --- a/logic/doorcontroller2.lua +++ b/logic/doorcontroller2.lua @@ -129,7 +129,8 @@ end local function exchange_node(pos, item, param2) local node = minetest.get_node_or_nil(pos) local meta = minetest.get_meta(pos) - if node and (not meta or not next((meta:to_table()).fields)) then + if node and (not meta or not next((meta:to_table()).fields)) or + minetest.get_item_group(node.name, "techage_door") then if item and item:get_name() ~= "" and param2 then minetest.swap_node(pos, {name = item:get_name(), param2 = param2}) else diff --git a/logic/gateblock.lua b/logic/gateblock.lua index f0d7c7b..93a7bec 100644 --- a/logic/gateblock.lua +++ b/logic/gateblock.lua @@ -76,7 +76,8 @@ for idx,pgn in ipairs(tPgns) do use_texture_alpha = true, sunlight_propagates = true, sounds = default.node_sound_stone_defaults(), - groups = {cracky=2, choppy=2, crumbly=2, not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, + groups = {cracky=2, choppy=2, crumbly=2, techage_door = 1, + not_in_creative_inventory = idx==NUM_TEXTURES and 0 or 1}, is_ground_content = false, drop = "techage:gateblock"..NUM_TEXTURES, },