From b5f6e51f13d2b614c6cb8b800e1a7619cf218512 Mon Sep 17 00:00:00 2001 From: alek13 Date: Tue, 20 Feb 2024 23:36:52 +0300 Subject: [PATCH] Wooden blocks: add tapestry top from other woods. Closes #1229 --- mods/_various/castle/locale/ru.txt | 10 ++++- mods/_various/castle/tapestry.lua | 71 ++++++++++++++++++------------ 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/mods/_various/castle/locale/ru.txt b/mods/_various/castle/locale/ru.txt index 5be47839a..084f87ef9 100644 --- a/mods/_various/castle/locale/ru.txt +++ b/mods/_various/castle/locale/ru.txt @@ -103,7 +103,15 @@ Orc Brick Arrowslit with Hole=Т-образная бойница из оркск Mordor Stone Arrowslit with Hole=Т-образная бойница из камня Мордора ### tapestry.lua ### -Tapestry Top=Основание для гобелена +@1 Tapestry Top=Основание для гобелена из @1 +Apple=яблони +Jungle Wood=эвкадипта +Alder=ольхи +Birch=берёзы +Hardwood=твёрдой древесины +Lebethron=лебетрона +Mallorn=малорна +Pine=сосны White Tapestry=Белый гобелен White Tapestry (Long)=Белый гобелен (длинный) White Tapestry (Very Long)=Белый гобелен (очень длинный) diff --git a/mods/_various/castle/tapestry.lua b/mods/_various/castle/tapestry.lua index 27ed7ed4f..83c7b158b 100644 --- a/mods/_various/castle/tapestry.lua +++ b/mods/_various/castle/tapestry.lua @@ -1,36 +1,51 @@ local SL = lord.require_intllib() -local tapestry = {} +local function register_tapestry_top(node_name, craft_from, description_material, texture) + local node_and_selection_box = { + type = "fixed", + fixed = { { -0.600000, -0.500000, 0.375000, 0.600000, -0.375000, 0.500000 }, }, + } + minetest.register_node(node_name, { + drawtype = "nodebox", + description = SL("@1 Tapestry Top", description_material), + tiles = { texture }, + sunlight_propagates = true, + groups = { flammable = 3, oddly_breakable_by_hand = 1 }, + sounds = default.node_sound_defaults(), + paramtype = "light", + paramtype2 = "facedir", + node_box = node_and_selection_box, + selection_box = node_and_selection_box, + }) -minetest.register_node("castle:tapestry_top", { - drawtype = "nodebox", - description = SL("Tapestry Top"), - tiles = {"default_wood.png"}, - sunlight_propagates = true, - groups = {flammable=3,oddly_breakable_by_hand=1}, - sounds = default.node_sound_defaults(), - paramtype = "light", - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - {-0.600000,-0.500000,0.375000,0.600000,-0.375000,0.500000}, - }, - }, - selection_box = { - type = "fixed", - fixed = { - {-0.600000,-0.500000,0.375000,0.600000,-0.375000,0.500000}, - }, - }, -}) + minetest.register_craft({ + type = "shapeless", + output = node_name, + recipe = { craft_from }, + }) +end +-- [code-labels]: planks, sticks +local tapestry_tops = { +-- node_name craft_from description_material texture + { "castle:tapestry_top", "default:stick", SL("Apple"), "default_wood.png" }, + { "castle:tapestry_top_junglewood", "lottblocks:stick_junglewood", SL("Jungle Wood"),"default_junglewood.png" }, + { "castle:tapestry_top_alder", "lottblocks:stick_alder", SL("Alder"), "lottplants_alderwood.png" }, + { "castle:tapestry_top_birch", "lottblocks:stick_birch", SL("Birch"), "lottplants_birchwood.png" }, + { "castle:tapestry_top_hardwood", "lottblocks:stick_hardwood", SL("Hardwood"), "lottblocks_hardwood.png" }, + { "castle:tapestry_top_lebethron", "lottblocks:stick_lebethron", SL("Lebethron"), "lottplants_lebethronwood.png"}, + { "castle:tapestry_top_mallorn", "lottblocks:stick_mallorn", SL("Mallorn"), "lottplants_mallornwood.png" }, + { "castle:tapestry_top_pine", "lottblocks:stick_pine", SL("Pine"), "lottplants_pinewood.png" }, +-- { "castle:tapestry_top_fir", "lottblocks:stick_fir", SL("Fir"), "lottplants_fir_wood.png" }, +} +for _, tapestry_top in pairs(tapestry_tops) do + register_tapestry_top(unpack(tapestry_top)) +end -minetest.register_craft({ - type = "shapeless", - output = 'castle:tapestry_top', - recipe = {'default:stick'}, -}) +---------------- +--- Tapestry --- +---------------- +local tapestry = {} tapestry.colours = { {"white", "White", "white"}, {"grey", "Grey", "grey"},