From 339709d74f450381a6fd42559a15a27017d21fd2 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 6 Mar 2021 10:06:27 +0100 Subject: [PATCH] Register all kind of door nodes for the doorcontroller --- logic/doorcontroller2.lua | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/logic/doorcontroller2.lua b/logic/doorcontroller2.lua index 817b3c2..f27999a 100644 --- a/logic/doorcontroller2.lua +++ b/logic/doorcontroller2.lua @@ -364,3 +364,43 @@ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) mark_position(name, pointed_thing.under) end end) + +function logic.register_doorcontroller_nodes(node_names) + for _,name in ipairs(node_names or {}) do + RegisteredNodes[name] = true + end +end + +local Doors = { + "doors:door_steel", + "doors:prison_door", + "doors:rusty_prison_door", + "doors:trapdoor_steel", + "doors:door_glass", "doors:door_obsidian_glass", + "doors:japanese_door", + "doors:screen_door", + "doors:slide_door", + "doors:trapdoor", + "doors:woodglass_door", + "xpanes:door_steel_bar", + "xpanes:trapdoor_steel_bar", +} + +for _, name in ipairs(Doors) do + for _, postfix in ipairs({"a", "b", "c", "d"}) do + logic.register_doorcontroller_nodes({name .. "_" .. postfix}) + end +end + +local ProtectorDoors = { + "protector:door_steel", + "protector:door_wood", + "protector:trapdoor", + "protector:trapdoor_steel", +} + +for _, name in ipairs(ProtectorDoors) do + for _, postfix in ipairs({"b_1", "b_2", "t_1", "t_2"}) do + logic.register_doorcontroller_nodes({name .. "_" .. postfix}) + end +end