This mod adds and utilizes many functions (which form mod's API), and some of them can be used to expand its content.
Useful links if you're getting started with MT modding:
- Minetest Modding Book (unofficial but still must-have for beginners)
- Minetest Lua API (useful when you're trying to find a specific function in Minetest itself)
- Documentation for Lua (programming language that Minetest uses for mods)
Plus some MCL-specific stuff:
- MineClone's API (good as a starting point; references many API functions that you may want to use)
Chairs and tables
function mcl_decor.register_chair_and_table(name, desc, desc2, material, tiles, group)
This function registers both chair and a table at once using params provided. Quite useful if your mod adds new type(s) of wood and you want to support mine.
Parameters:
-
name
: name of the wood type, which will be included in the node name as mcl_decor:name_chairExample:
"larch"
-
desc
: description (visible name) for the chair. Hint: Append S before it and put it into parentheses to make it translatableExample:
S("Larch Chair")
-
desc2
: description (visible name) for the table. Hint: Append S before it and put it into parentheses to make it translatableExample:
S("Larch Table")
-
material
: name (including modname) of node which should be used as main material to craft registered chairs and tablesExample:
"mcl_larch:larchwood"
-
tiles
: texture which will be used for registered chairs and tablesExample:
"mcl_larch_larchwood.png"
-
group
: luatable of groups, which applies only if specified (if not, there's a fallback luatable which pretty much suits ANY wood out there). you can ignore that param unless your type of wood is slippery, bouncy or fire-resistant. About MCL groups
Full usage example:
mcl_decor.register_chair_and_table("larch", S("Larch Chair"), S("Larch Table"), "mcl_larch:larchwood", "mcl_larch_larchwood.png")
[See definiton] [See usage]
function mcl_decor.register_slab_table(name, desc, material, tiles, group)
This function registers a slab table.
Parameters:
-
name
: name of the wood type, which will be included in the node name as mcl_decor:name_stableExample:
"larch"
-
desc
: description (visible name) for the slab table. Hint: Append S before it and put it into parentheses to make it translatableExample:
S("Larch Slab Table")
-
material
: name (including modname) of node which should be used as main material to craft the slab tableExample:
"mcl_larch:larchwood"
-
tiles
: texture which will be used for the slab tableExample:
"mcl_larch_larchwood.png"
-
group
: luatable of groups, which applies only if specified (if not, there's a fallback luatable which pretty much suits ANY wood out there). you can ignore that param unless your type of wood is slippery, bouncy or fire-resistant. About MCL groups
Full usage example:
mcl_decor.register_slab_table("larch", S("Larch Slab Table"), "mcl_larch:larchwood", "mcl_larch_larchwood.png")
[See definiton] [See usage]
Hedges
function mcl_decor.register_hedge(name, desc, material, tiles)
This function registers a hedge.
Parameters:
-
name
: name of the wood type, which will be included in the node name as mcl_fences:name_hedgeExample:
"larch"
-
desc
: description (visible name) for the hedge. Hint: Append S before it and put it into parentheses to make it translatableExample:
S("Larch Hedge")
-
material
: name (including modname) of node which should be used as main material to craft the hedgeExample:
"mcl_larch:larchleaves"
-
tiles
: texture which will be used for the hedgeExample:
"mcl_larch_larchleaves.png"
Full usage example:
mcl_decor.register_hedge("larch", S("Larch Hedge"), "mcl_larch:larchleaves", "mcl_larch_larchleaves.png")
[See definiton] [See usage]
Paths
function mcl_decor.register_path(name, desc, material, tiles, sgroup, sounds)
This function registers a path. Quite useful if your mod adds new type(s) of stone and you want to support mine.
Parameters:
-
name
: name of the wood type, which will be included in the node name as mcl_decor:name_pathExample:
"slate"
-
desc
: description (visible name) for the path. Hint: Append S before it and put it into parentheses to make it translatableExample:
S("Slate Path")
-
material
: name (including modname) of node which should be used as main material to craft the pathExample:
"mcl_slate:slate"
-
tiles
: texture which will be used for the pathExample:
"mcl_slate_slate.png"
-
sgroup
: group which will be applied to the path alongside predefined ones. based on the material: use"pickaxey"
if it is pickaxey and"shovely"
if it is shovely. About MCL groupsExample:
"pickaxey"
-
sounds
: sound that will play when interacting with the pathExample:
mcl_sounds.node_sound_stone_defaults()
Full usage example:
-
mcl_decor.register_path( "slate", S("Slate Path"), "mcl_slate:slate", "mcl_slate_slate.png", "pickaxey", mcl_sounds.node_sound_stone_defaults() )