Skip to content

Commit

Permalink
Wooden blocks: add tapestry top from other woods. Closes #1229
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Feb 20, 2024
1 parent 61458a4 commit b5f6e51
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 29 deletions.
10 changes: 9 additions & 1 deletion mods/_various/castle/locale/ru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)=Белый гобелен (очень длинный)
Expand Down
71 changes: 43 additions & 28 deletions mods/_various/castle/tapestry.lua
Original file line number Diff line number Diff line change
@@ -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"},
Expand Down

0 comments on commit b5f6e51

Please sign in to comment.