1
0
Fork 0

Add mangrove to wood api

This commit is contained in:
cora 2022-08-10 05:03:43 +02:00
parent 715c3b8044
commit 121b122dfe
9 changed files with 12 additions and 135 deletions

View File

@ -16,121 +16,9 @@ local propagule_allowed_nodes = {
"mcl_mud:mud", "mcl_mud:mud",
} }
local propagule_water_nodes = {"mcl_mud:mud","mcl_core:dirt","mcl_core:coarse_dirt","mcl_core:clay"} local propagule_water_nodes = {"mcl_mud:mud","mcl_core:dirt","mcl_core:coarse_dirt","mcl_core:clay"}
--mcl_wood.register_wood("mangrove") mcl_wood.register_wood("mangrove",false,true)
--"mcl_lush_caves:moss","mcl_lush_caves:rooted_dirt --"mcl_lush_caves:moss","mcl_lush_caves:rooted_dirt
--[[]
local function get_drops(fortune_level)
local apple_chances = {200, 180, 160, 120, 40}
local stick_chances = {50, 45, 30, 35, 10}
local sapling_chances = {20, 16, 12, 10}
return {
max_items = 1,
items = {
{
items = {"mcl_mangrove:propagule"},
rarity = sapling_chances[fortune_level + 1] or sapling_chances[fortune_level]
},
{
items = {"mcl_core:stick 1"},
rarity = stick_chances[fortune_level + 1]
},
{
items = {"mcl_core:stick 2"},
rarity = stick_chances[fortune_level + 1]
},
{
items = {"mcl_core:apple"},
rarity = apple_chances[fortune_level + 1]
}
}
}
end
minetest.register_node("mcl_mangrove:mangrove_tree", {
description = S("Mangrove Wood"),
_doc_items_longdesc = S("The trunk of a Mangrove tree."),
_doc_items_hidden = false,
tiles = {"mcl_mangrove_log_top.png", "mcl_mangrove_log_top.png", "mcl_mangrove_log.png"},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_place = mcl_util.rotate_axis,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = "mcl_mangrove:mangrove_stripped_trunk",
})
minetest.register_node("mcl_mangrove:mangrove_tree_bark", {
description = S("Mangrove Bark"),
_doc_items_longdesc = S("The bark of a Mangrove tree."),
_doc_items_hidden = false,
tiles = {"mcl_mangrove_log.png", "mcl_mangrove_log.png", "mcl_mangrove_log.png"},
paramtype2 = "facedir",
groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_place = mcl_util.rotate_axis,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = "mcl_mangrove:mangrove_stripped_bark",
})
minetest.register_node("mcl_mangrove:mangrove_wood", {
description = S("Mangrove Wood Planks"),
_doc_items_longdesc = doc.sub.items.temp.build,
_doc_items_hidden = false,
tiles = {"mcl_mangrove_planks.png"},
is_ground_content = false,
groups = {handy=1,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 3,
_mcl_hardness = 2,
})
minetest.register_node("mcl_mangrove:mangroveleaves", {
description = S("Mangrove Leaves"),
_doc_items_longdesc = S("mangrove leaves are grown from mangrove trees."),
_doc_items_hidden = false,
drawtype = "allfaces_optional",
waving = 2,
place_param2 = 1, -- Prevent leafdecay for placed nodes
tiles = {"mcl_mangrove_leaves.png"},
paramtype = "light",
groups = {handy=1,shearsy=1,swordy=1, leafdecay=10, flammable=2, leaves=1, deco_block=1, dig_by_piston=1, fire_encouragement=30, fire_flammability=60},
_mcl_shears_drop = true,
sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
_mcl_silk_touch_drop = true,
_mcl_fortune_drop = { get_drops(1), get_drops(2), get_drops(3), get_drops(4) },
})
minetest.register_node("mcl_mangrove:mangrove_stripped_trunk", {
description = "The stripped wood of a Mangove tree",
_doc_items_longdesc = "The stripped wood of a Mangove tree",
_doc_items_hidden = false,
tiles ={"mcl_stripped_mangrove_log_top.png","mcl_stripped_mangrove_log_side.png",},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy=1, axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = mcl_util.rotate_axis_and_place,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_node("mcl_mangrove:mangrove_stripped_bark", {
description = "The stripped bark of a Mangove tree",
_doc_items_longdesc = "The stripped bark of a Mangove tree",
_doc_items_hidden = false,
tiles ={"mcl_stripped_mangrove_log_side.png","mcl_stripped_mangrove_log_side.png",},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy=1, axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = mcl_util.rotate_axis_and_place,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_node("mcl_mangrove:mangrove_roots", { minetest.register_node("mcl_mangrove:mangrove_roots", {
description = "Mangrove_Roots", description = "Mangrove_Roots",
@ -364,8 +252,8 @@ mcl_doors:register_door("mcl_mangrove:mangrove_door", {
groups = {handy=1,axey=1, material_wood=1, flammable=-1}, groups = {handy=1,axey=1, material_wood=1, flammable=-1},
_mcl_hardness = 3, _mcl_hardness = 3,
_mcl_blast_resistance = 3, _mcl_blast_resistance = 3,
tiles_bottom = {"mcl_mangrove_door_bottom.png", "mcl_mangrove_planks.png"}, tiles_bottom = {"mcl_mangrove_door_bottom.png", "mcl_wood_planks_mangrove.png"},
tiles_top = {"mcl_mangrove_door_top.png", "mcl_mangrove_planks.png"}, tiles_top = {"mcl_mangrove_door_top.png", "mcl_wood_planks_mangrove.png"},
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
}) })
@ -374,7 +262,7 @@ mcl_doors:register_trapdoor("mcl_mangrove:mangrove_trapdoor", {
_doc_items_longdesc = S("Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."), _doc_items_longdesc = S("Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."),
_doc_items_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."), _doc_items_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."),
tile_front = "mcl_mangrove_trapdoor.png", tile_front = "mcl_mangrove_trapdoor.png",
tile_side = "mcl_mangrove_planks.png", tile_side = "mcl_wood_planks_mangrove.png",
wield_image = "mcl_mangrove_trapdoor.png", wield_image = "mcl_mangrove_trapdoor.png",
groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1}, groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1},
_mcl_hardness = 3, _mcl_hardness = 3,
@ -394,20 +282,6 @@ mcl_fences.register_fence_and_fence_gate(
mcl_sounds.node_sound_wood_defaults(), "mcl_mangrove_mangrove_wood_fence_gate_open", "mcl_mangrove_mangrove_wood_fence_gate_close", 1, 1, mcl_sounds.node_sound_wood_defaults(), "mcl_mangrove_mangrove_wood_fence_gate_open", "mcl_mangrove_mangrove_wood_fence_gate_close", 1, 1,
"mcl_mangrove_fence_gate.png") "mcl_mangrove_fence_gate.png")
mcl_stairs.register_stair("mangrove_wood", "mcl_mangrove:mangrove_wood",
{handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_mangrove_planks.png"},
S("Mangrove Wood Stairs"),
mcl_sounds.node_sound_wood_defaults(), 3, 2,
"woodlike")
mcl_stairs.register_slab("mangrove_wood", "mcl_mangrove:mangrove_wood",
{handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
{"mcl_mangrove_planks.png"},
S("Mangrove Wood Slab"),
mcl_sounds.node_sound_wood_defaults(), 3, 2,
S("Double Mangrove Wood Slab"))
minetest.register_craft({ minetest.register_craft({
output = "mcl_mangrove:mangrove_tree_bark 3", output = "mcl_mangrove:mangrove_tree_bark 3",
recipe = { recipe = {
@ -541,4 +415,3 @@ minetest.register_abm({
end end
end end
}) })
--]]

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -218,7 +218,7 @@ function readable_name(str)
end end
function mcl_wood.register_wood(name) function mcl_wood.register_wood(name,nether,nosap)
local rname = readable_name(name) local rname = readable_name(name)
register_tree_trunk("tree_"..name, S(rname.." Wood"), S(rname.." Bark"), S("The trunk of an "..name.." tree."), "mcl_wood_tree_"..name.."_top.png", "mcl_wood_tree_"..name..".png", "mcl_wood:stripped_"..name) register_tree_trunk("tree_"..name, S(rname.." Wood"), S(rname.." Bark"), S("The trunk of an "..name.." tree."), "mcl_wood_tree_"..name.."_top.png", "mcl_wood_tree_"..name..".png", "mcl_wood:stripped_"..name)
@ -226,7 +226,9 @@ function mcl_wood.register_wood(name)
register_wooden_planks("wood_"..name, S(rname.." Wood Planks"), {"mcl_wood_planks_"..name..".png"}) register_wooden_planks("wood_"..name, S(rname.." Wood Planks"), {"mcl_wood_planks_"..name..".png"})
register_sapling("sapling_"..name, S(rname.." Sapling"),S("When placed on soil (such as dirt) and exposed to light, an "..name.." sapling will grow into an "..name.." after some time."),S("Needs soil and light to grow"),"mcl_wood_sapling_"..name..".png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16}) if not nosap then
register_sapling("sapling_"..name, S(rname.." Sapling"),S("When placed on soil (such as dirt) and exposed to light, an "..name.." sapling will grow into an "..name.." after some time."),S("Needs soil and light to grow"),"mcl_wood_sapling_"..name..".png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16})
end
register_leaves("leaves_"..name, S(rname.." Leaves"), S(rname.." leaves are grown from "..name.." trees."), {"mcl_wood_leaves_"..name..".png"}, "mcl_wood:sapling_"..name, true, {20, 16, 12, 10}) register_leaves("leaves_"..name, S(rname.." Leaves"), S(rname.." leaves are grown from "..name.." trees."), {"mcl_wood_leaves_"..name..".png"}, "mcl_wood:sapling_"..name, true, {20, 16, 12, 10})

View File

@ -10,20 +10,22 @@ minetest.register_alias("default:acacia_tree", "mcl_core:acaciatree")
minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves") minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves")
minetest.register_alias("mcl_core:birchtree","mcl_wood:tree_birch") minetest.register_alias("mcl_core:birchtree","mcl_wood:tree_birch")
minetest.register_alias("mcl_core:big_oaktree","mcl_wood:tree_dark_oak") minetest.register_alias("mcl_core:darktree","mcl_wood:tree_dark_oak")
minetest.register_alias("mcl_core:acaciatree","mcl_wood:tree_acacia") minetest.register_alias("mcl_core:acaciatree","mcl_wood:tree_acacia")
minetest.register_alias("mcl_core:jungletree","mcl_wood:tree_jungle") minetest.register_alias("mcl_core:jungletree","mcl_wood:tree_jungle")
minetest.register_alias("mcl_core:sprucetree","mcl_wood:tree_spruce") minetest.register_alias("mcl_core:sprucetree","mcl_wood:tree_spruce")
minetest.register_alias("mcl_core:tree","mcl_wood:tree_oak") minetest.register_alias("mcl_core:tree","mcl_wood:tree_oak")
minetest.register_alias("default:tree","mcl_wood:tree_oak") minetest.register_alias("default:tree","mcl_wood:tree_oak")
minetest.register_alias("mcl_mangrove:mangrove_tree","mcl_wood:tree_mangrove")
minetest.register_alias("mcl_core:birchleaves","mcl_wood:leaves_birch") minetest.register_alias("mcl_core:birchleaves","mcl_wood:leaves_birch")
minetest.register_alias("mcl_core:big_oakleaves","mcl_wood:leaves_dark_oak") minetest.register_alias("mcl_core:darkleaves","mcl_wood:leaves_dark_oak")
minetest.register_alias("mcl_core:acacialeaves","mcl_wood:leaves_acacia") minetest.register_alias("mcl_core:acacialeaves","mcl_wood:leaves_acacia")
minetest.register_alias("mcl_core:jungleleaves","mcl_wood:leaves_jungle") minetest.register_alias("mcl_core:jungleleaves","mcl_wood:leaves_jungle")
minetest.register_alias("mcl_core:spruceleaves","mcl_wood:leaves_spruce") minetest.register_alias("mcl_core:spruceleaves","mcl_wood:leaves_spruce")
minetest.register_alias("mcl_core:leaves","mcl_wood:leaves_oak") minetest.register_alias("mcl_core:leaves","mcl_wood:leaves_oak")
minetest.register_alias("default:leaves","mcl_wood:leaves_oak") minetest.register_alias("default:leaves","mcl_wood:leaves_oak")
minetest.register_alias("mcl_mangrove:mangroveleaves","mcl_wood:leaves_mangrove")
minetest.register_alias("mcl_core:birchwood","mcl_wood:wood_birch") minetest.register_alias("mcl_core:birchwood","mcl_wood:wood_birch")
minetest.register_alias("mcl_core:big_oakwood","mcl_wood:wood_dark_oak") minetest.register_alias("mcl_core:big_oakwood","mcl_wood:wood_dark_oak")