Add more comments to the code (why not?)

v1.3 soongit status!
This commit is contained in:
Mikita Wiśniewski 2022-09-30 11:02:18 +07:00
parent 5a32f4595d
commit ce5324af35
4 changed files with 6 additions and 2 deletions

View File

@ -2,6 +2,7 @@
local S = minetest.get_translator(minetest.get_current_modname())
-- COLORS TABLE
mcl_decor.colors = {
-- color, wool texture, armchair desc, curtains desc, dyed planks desc, dye, colorgroup, hexcolor
{"white", "wool_white", S("White Armchair"), S("White Curtains"), S("White Planks"), "white", "unicolor_white", "#EDEDED"},
@ -93,6 +94,7 @@ for _, row in ipairs(mcl_decor.colors) do
minetest.register_node("mcl_decor:curtain_"..color, {
description = desc2,
tiles = {
-- very hacky way to make curtains render as they should
wooltile..".png".."^mcl_decor_curtain_alpha.png^[makealpha:255,126,126^mcl_decor_curtain_overlay.png",
wooltile..".png".."^mcl_decor_curtain_alpha.png^[makealpha:255,126,126^mcl_decor_curtain_overlay.png^[transformFY",
wooltile..".png".."^mcl_decor_curtain_overlay.png^[transformR270",
@ -115,6 +117,7 @@ for _, row in ipairs(mcl_decor.colors) do
},
_mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
-- function to close curtains
on_rightclick = function(pos, node, _, itemstack)
minetest.set_node(pos, {name="mcl_decor:curtain_"..color.."_closed", param2=node.param2})
return itemstack
@ -143,6 +146,7 @@ for _, row in ipairs(mcl_decor.colors) do
drop = "mcl_decor:curtain_"..color,
_mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
-- function to open curtains
on_rightclick = function(pos, node, clicker, itemstack)
minetest.set_node(pos, {name="mcl_decor:curtain_"..color, param2=node.param2})
return itemstack

View File

@ -25,6 +25,7 @@ mcl_decor.register_hedge("spruce", S("Spruce Hedge"), "mcl_core:spruceleaves", "
mcl_decor.register_hedge("birch", S("Birch Hedge"), "mcl_core:birchleaves", "mcl_core_leaves_birch.png")
mcl_decor.register_hedge("mangrove", S("Mangrove Hedge"), "mcl_mangrove:mangroveleaves", "mcl_mangrove_leaves.png")
-- all hedges should be fuel
minetest.register_craft({
type = "fuel",
recipe = "group:hedge",

View File

@ -1,4 +1,4 @@
title = MineClone Furniture and decorations
title = MineClone2 Furniture and decorations
name = mcl_decor
description = Adds more decoration and furniture blocks to MineClone 2
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs, mcl_title, mcl_fences, mcl_mangrove, mcl_deepslate, mcl_crimson

View File

@ -158,7 +158,6 @@ mcl_decor.register_chair_and_table("birch", S("Birch Chair"), S("Birch Table"),
mcl_decor.register_chair_and_table("mangrove", S("Mangrove Chair"), S("Mangrove Table"), "mcl_mangrove:mangrove_wood", "mcl_mangrove_planks.png")
mcl_decor.register_chair_and_table("crimson", S("Crimson Chair"), S("Crimson Table"), "mcl_crimson:crimson_hyphae_wood", "crimson_hyphae_wood.png")
mcl_decor.register_chair_and_table("warped", S("Warped Chair"), S("Warped Table"), "mcl_crimson:warped_hyphae_wood", "warped_hyphae_wood.png")
mcl_decor.register_slab_table("wooden", S("Oak Slab Table"), "mcl_core:wood", "default_wood.png")
mcl_decor.register_slab_table("dark_oak", S("Dark Oak Slab Table"), "mcl_core:darkwood", "mcl_core_planks_big_oak.png")
mcl_decor.register_slab_table("jungle", S("Jungle Slab Table"), "mcl_core:junglewood", "default_junglewood.png")