Add slab tables and fix previous commit

This commit is contained in:
Mikita Wiśniewski 2022-03-23 12:23:35 +07:00
parent 494d13d3a6
commit 114f3a24fe
5 changed files with 65 additions and 2 deletions

45
api.lua
View File

@ -135,13 +135,55 @@ function mcl_decor.register_chair_and_table(name, desc, name2, desc2, material,
sounds = mcl_sounds.node_sound_wood_defaults(),
})
minetest.register_craft({
output = name,
output = name2.." 2",
recipe = {
{material, material, material},
{"mcl_core:stick", "", "mcl_core:stick"},
{"mcl_core:stick", "", "mcl_core:stick"}
}
})
minetest.register_craft({
type = "fuel",
recipe = name2,
burntime = 10,
})
end
function mcl_decor.register_slab_table(name, desc, material, tiles)
minetest.register_node(name, {
description = desc,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.125, 0.125, 0, 0.125},
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
}
},
--[[
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
},
]]
tiles = {tiles},
is_ground_content = false,
paramtype = "light",
stack_max = 64,
sunlight_propagates = true,
groups = {handy=1, axey=1, attached_node=1, material_wood=1, deco_block=1, flammable=-1},
_mcl_hardness = 2,
_mcl_blast_resistance = 3,
sounds = mcl_sounds.node_sound_wood_defaults(),
})
minetest.register_craft({
output = name.." 3",
recipe = {
{material, material, material},
{"", "mcl_core:stick", ""},
{"", "mcl_core:stick", ""}
}
})
minetest.register_craft({
type = "fuel",
recipe = name,
@ -227,5 +269,6 @@ function mcl_decor.register_dyed_planks(name, desc, hexcolor, dye, colorgroup)
recipe = "mcl_decor:"..name,
burntime = 12,
})
-- maybe descriptions of slabs/stairs after that workaround will be VERY CRAPPY (especially with translations via locales), but at least it works
mcl_stairs.register_stair_and_slab_simple(name, "mcl_decor:"..name, desc..S(" Stair"), desc..S(" Slab"), S("Double")..desc..S(" Slab"))
end

View File

@ -1,7 +1,8 @@
-- mcl_decor/init.lua
mcl_decor = {}
local modpath = minetest.get_modpath(minetest.get_current_modname())
-- load files
dofile(modpath.."/api.lua")
dofile(modpath.."/register.lua")

View File

@ -19,6 +19,12 @@ Birch Table=Берёзовый стол
Dark Oak Table=Стол из тёмного дуба
Jungle Table=Стол из тропического дерева
Spruce Table=Еловый стол
Oak Slab Table=Дубовый полублочный стол
Dark Oak Slab Table=Полублочный стол из тёмного дуба
Jungle Slab Table=Полублочный стол из тропического дерева
Spruce Slab Table=Еловый полублочный стол
Acacia Slab Table=Полублочный стол из акации
Birch Slab Table=Берёзовый полублочный стол
White Planks=Белые доски
Grey Planks=Серые доски
Light Grey Planks=Светло-серые доски

View File

@ -19,6 +19,12 @@ Birch Table=
Dark Oak Table=
Jungle Table=
Spruce Table=
Oak Slab Table=
Dark Oak Slab Table=
Jungle Slab Table=
Spruce Slab Table=
Acacia Slab Table=
Birch Slab Table=
White Planks=
Grey Planks=
Light Grey Planks=

View File

@ -149,6 +149,13 @@ mcl_decor.register_chair_and_table("mcl_decor:spruce_chair", S("Spruce Chair"),
mcl_decor.register_chair_and_table("mcl_decor:acacia_chair", S("Acacia Chair"), "mcl_decor:acacia_table", S("Acacia Table"), "mcl_core:acaciawood", "default_acacia_wood.png")
mcl_decor.register_chair_and_table("mcl_decor:birch_chair", S("Birch Chair"), "mcl_decor:birch_table", S("Birch Table"), "mcl_core:birchwood", "mcl_core_planks_birch.png")
mcl_decor.register_slab_table("mcl_decor:wooden_stable", S("Oak Slab Table"), "mcl_core:wood", "default_wood.png")
mcl_decor.register_slab_table("mcl_decor:dark_oak_stable", S("Dark Oak Slab Table"), "mcl_core:darkwood", "mcl_core_planks_big_oak.png")
mcl_decor.register_slab_table("mcl_decor:jungle_stable", S("Jungle Slab Table"), "mcl_core:junglewood", "default_junglewood.png")
mcl_decor.register_slab_table("mcl_decor:spruce_stable", S("Spruce Slab Table"), "mcl_core:sprucewood", "mcl_core_planks_spruce.png")
mcl_decor.register_slab_table("mcl_decor:acacia_stable", S("Acacia Slab Table"), "mcl_core:acaciawood", "default_acacia_wood.png")
mcl_decor.register_slab_table("mcl_decor:birch_stable", S("Birch Slab Table"), "mcl_core:birchwood", "mcl_core_planks_birch.png")
--- Armchairs ---