Combine chairs and tables registration function

and add optional depend for mcl_cozy... and something i forgor
This commit is contained in:
Mikita Wiśniewski 2022-03-22 21:48:22 +07:00
parent f4699123d8
commit 494d13d3a6
3 changed files with 15 additions and 20 deletions

10
api.lua
View File

@ -52,7 +52,8 @@ end
function mcl_decor.register_chair(name, desc, material, tiles)
function mcl_decor.register_chair_and_table(name, desc, name2, desc2, material, tiles)
-- chair part
minetest.register_node(name, {
description = desc,
drawtype = "nodebox",
@ -104,11 +105,10 @@ function mcl_decor.register_chair(name, desc, material, tiles)
recipe = name,
burntime = 8,
})
end
function mcl_decor.register_table(name, desc, material, tiles)
minetest.register_node(name, {
description = desc,
-- table part
minetest.register_node(name2, {
description = desc2,
drawtype = "nodebox",
node_box = {
type = "fixed",

View File

@ -1,4 +1,5 @@
name = mcl_decor
title = MineClone2 Furniture and decorations
description = Adds more decoration and furniture blocks to MineClone 2 (5)
depends = mcl_core, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs
optional_depends = mcl_cozy

View File

@ -140,20 +140,14 @@ minetest.register_craft({
})
--- Tables and Chairs ---
mcl_decor.register_chair("mcl_decor:wooden_chair", S("Oak Chair"), "mcl_core:wood", "default_wood.png")
mcl_decor.register_chair("mcl_decor:dark_oak_chair", S("Dark Oak Chair"), "mcl_core:darkwood", "mcl_core_planks_big_oak.png")
mcl_decor.register_chair("mcl_decor:jungle_chair", S("Jungle Chair"), "mcl_core:junglewood", "default_junglewood.png")
mcl_decor.register_chair("mcl_decor:spruce_chair", S("Spruce Chair"), "mcl_core:sprucewood", "mcl_core_planks_spruce.png")
mcl_decor.register_chair("mcl_decor:acacia_chair", S("Acacia Chair"), "mcl_core:acaciawood", "default_acacia_wood.png")
mcl_decor.register_chair("mcl_decor:birch_chair", S("Birch Chair"), "mcl_core:birchwood", "mcl_core_planks_birch.png")
mcl_decor.register_table("mcl_decor:wooden_table", S("Oak Table"), "mcl_core:wood", "default_wood.png")
mcl_decor.register_table("mcl_decor:dark_oak_table", S("Dark Oak Table"), "mcl_core:darkwood", "mcl_core_planks_big_oak.png")
mcl_decor.register_table("mcl_decor:jungle_table", S("Jungle Table"), "mcl_core:junglewood", "default_junglewood.png")
mcl_decor.register_table("mcl_decor:spruce_table", S("Spruce Table"), "mcl_core:sprucewood", "default_wood.png")
mcl_decor.register_table("mcl_decor:acacia_table", S("Acacia Table"), "mcl_core:acaciawood", "default_acacia_wood.png")
mcl_decor.register_table("mcl_decor:birch_table", S("Birch Table"), "mcl_core:birchwood", "mcl_core_planks_birch.png")
--- Tables and Chairs ---
mcl_decor.register_chair_and_table("mcl_decor:wooden_chair", S("Oak Chair"), "mcl_decor:wooden_table", S("Oak Table"), "mcl_core:wood", "default_wood.png")
mcl_decor.register_chair_and_table("mcl_decor:dark_oak_chair", S("Dark Oak Chair"), "mcl_decor:dark_oak_table", S("Dark Oak Table"), "mcl_core:darkwood", "mcl_core_planks_big_oak.png")
mcl_decor.register_chair_and_table("mcl_decor:jungle_chair", S("Jungle Chair"), "mcl_decor:jungle_table", S("Jungle Table"), "mcl_core:junglewood", "default_junglewood.png")
mcl_decor.register_chair_and_table("mcl_decor:spruce_chair", S("Spruce Chair"), "mcl_decor:spruce_table", S("Spruce Table"), "mcl_core:sprucewood", "mcl_core_planks_spruce.png")
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")