From 559e26d15d4b066485aed8b8b347162ecacfd050 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Thu, 18 Feb 2016 15:46:07 +0100 Subject: [PATCH] Doors: use latest API upstream change for recipes --- nodes.lua | 57 +++++++++++++++++++++++++++++++++++++++++------------ recipes.lua | 54 -------------------------------------------------- 2 files changed, 44 insertions(+), 67 deletions(-) diff --git a/nodes.lua b/nodes.lua index c6b8224..d62d9f5 100644 --- a/nodes.lua +++ b/nodes.lua @@ -208,24 +208,55 @@ xdecor.register("cushion_block", { groups = {snappy=3, flammable=3, fall_damage_add_percent=-75, not_in_creative_inventory=1} }) -local function door_access(door) return door:find("prison") end -for _, d in pairs({"japanese", "prison", "rusty_prison", - "screen", "slide", "woodglass"}) do +local function door_access(name) return name:find("prison") end +local xdecor_doors = { + japanese = { + {"group:wood", "default:paper"}, + {"default:paper", "group:wood"}, + {"group:wood", "default:paper"} + }, + prison = { + {"xpanes:bar", "xpanes:bar"}, + {"xpanes:bar", "xpanes:bar"}, + {"xpanes:bar", "xpanes:bar"} + }, + rusty_prison = { + {"xpanes:rusty_bar", "xpanes:rusty_bar"}, + {"xpanes:rusty_bar", "xpanes:rusty_bar"}, + {"xpanes:rusty_bar", "xpanes:rusty_bar"} + }, + screen = { + {"group:wood", "group:wood"}, + {"xpanes:chainlink", "xpanes:chainlink"}, + {"group:wood", "group:wood"} + }, + slide = { + {"default:paper", "default:paper"}, + {"default:paper", "default:paper"}, + {"group:wood", "group:wood"} + }, + woodglass = { + {"default:glass", "default:glass"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +} + +for name, recipe in pairs(xdecor_doors) do if not doors.register then return end - doors.register(d.."_door", { - tiles = {{name = "xdecor_"..d.."_door.png", backface_culling=true}}, - description = string.gsub(" "..d, "%W%l", string.upper):sub(2):gsub("_", " ").." Door", - inventory_image = "xdecor_"..d.."_door_inv.png", - protected = door_access(d), + doors.register(name.."_door", { + tiles = {{name = "xdecor_"..name.."_door.png", backface_culling=true}}, + description = string.gsub(" "..name, "%W%l", string.upper):sub(2):gsub("_", " ").." Door", + inventory_image = "xdecor_"..name.."_door_inv.png", + protected = door_access(name), groups = {choppy=3, cracky=3, oddly_breakable_by_hand=1, flammable=2, door=1}, - material = "" + recipe = recipe }) - minetest.register_alias("xdecor:"..d.."_door", "doors:"..d.."_door") - minetest.register_alias("xdecor:"..d.."_door_a", "air") - minetest.register_alias("xdecor:"..d.."_door_b", "doors:"..d.."_door") + minetest.register_alias("xdecor:"..name.."_door", "doors:"..name.."_door") + minetest.register_alias("xdecor:"..name.."_door_a", "air") + minetest.register_alias("xdecor:"..name.."_door_b", "doors:"..name.."_door") end - minetest.register_alias("xdecor:prison_rust_door", "doors:rusty_prison_door") xdecor.register("empty_shelf", { diff --git a/recipes.lua b/recipes.lua index c013e99..37e46e8 100644 --- a/recipes.lua +++ b/recipes.lua @@ -211,15 +211,6 @@ minetest.register_craft({ {"group:leaves"} } }) - -minetest.register_craft({ - output = "doors:japanese_door", - recipe = { - {"group:wood", "default:paper"}, - {"default:paper", "group:wood"}, - {"group:wood", "default:paper"} - } -}) minetest.register_craft({ output = "xdecor:lantern", @@ -263,24 +254,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "doors:prison_door", - recipe = { - {"xpanes:bar", "xpanes:bar"}, - {"xpanes:bar", "xpanes:bar"}, - {"xpanes:bar", "xpanes:bar"} - } -}) - -minetest.register_craft({ - output = "doors:rusty_prison_door", - recipe = { - {"xpanes:rusty_bar", "xpanes:rusty_bar"}, - {"xpanes:rusty_bar", "xpanes:rusty_bar"}, - {"xpanes:rusty_bar", "xpanes:rusty_bar"} - } -}) - minetest.register_craft({ output = "xdecor:rope", recipe = { @@ -289,24 +262,6 @@ minetest.register_craft({ {"farming:string"} } }) - -minetest.register_craft({ - output = "doors:screen_door", - recipe = { - {"group:wood", "group:wood"}, - {"xpanes:chainlink", "xpanes:chainlink"}, - {"group:wood", "group:wood"} - } -}) - -minetest.register_craft({ - output = "doors:slide_door", - recipe = { - {"default:paper", "default:paper"}, - {"default:paper", "default:paper"}, - {"group:wood", "group:wood"} - } -}) minetest.register_craft({ output = "xdecor:stone_tile 2", @@ -394,12 +349,3 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "doors:woodglass_door", - recipe = { - {"default:glass", "default:glass"}, - {"group:wood", "group:wood"}, - {"group:wood", "group:wood"} - } -}) -