Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
cora | ddac066c7e | |
cora | 121b122dfe | |
cora | 715c3b8044 | |
cora | cc8b8acd81 |
|
@ -22,7 +22,6 @@ dofile(modpath.."/functions.lua")
|
|||
dofile(modpath.."/nodes_base.lua") -- Simple solid cubic nodes with simple definitions
|
||||
dofile(modpath.."/nodes_liquid.lua") -- Liquids
|
||||
dofile(modpath.."/nodes_cactuscane.lua") -- Cactus and sugar canes
|
||||
dofile(modpath.."/nodes_trees.lua") -- Tree nodes: Wood, Planks, Sapling, Leaves
|
||||
dofile(modpath.."/nodes_glass.lua") -- Glass
|
||||
dofile(modpath.."/nodes_climb.lua") -- Climbable nodes
|
||||
dofile(modpath.."/nodes_misc.lua") -- Other and special nodes
|
||||
|
|
|
@ -1,275 +0,0 @@
|
|||
-- Tree nodes: Wood, Wooden Planks, Sapling, Leaves, Stripped Wood
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local mod_screwdriver = minetest.get_modpath("screwdriver")
|
||||
|
||||
local on_rotate
|
||||
if mod_screwdriver then
|
||||
on_rotate = screwdriver.rotate_3way
|
||||
end
|
||||
|
||||
-- Register tree trunk (wood) and bark
|
||||
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_variant)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
tiles = {tile_inner, tile_inner, tile_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
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 = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_variant = stripped_variant,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
description = description_bark,
|
||||
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of a tree trunk."),
|
||||
tiles = {tile_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_variant = stripped_variant.."_bark",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:"..subname.."_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Register stripped trunk and stripped wood
|
||||
local function register_stripped_trunk(subname, description_stripped_trunk, description_stripped_bark, longdesc, longdesc_wood, tile_stripped_inner, tile_stripped_bark)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_stripped_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
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 = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
description = description_stripped_bark,
|
||||
_doc_items_longdesc = longdesc_wood,
|
||||
tiles = {tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1, axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:"..subname.."_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
{ "mcl_core:"..subname, "mcl_core:"..subname },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local function register_wooden_planks(subname, description, tiles)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description,
|
||||
_doc_items_longdesc = doc.sub.items.temp.build,
|
||||
_doc_items_hidden = false,
|
||||
tiles = tiles,
|
||||
stack_max = 64,
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
local function register_leaves(subname, description, longdesc, tiles, sapling, drop_apples, sapling_chances, leafdecay_distance)
|
||||
if leafdecay_distance == nil then
|
||||
leafdecay_distance = 4
|
||||
end
|
||||
local apple_chances = {200, 180, 160, 120, 40}
|
||||
local stick_chances = {50, 45, 30, 35, 10}
|
||||
|
||||
local function get_drops(fortune_level)
|
||||
local drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {sapling},
|
||||
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]
|
||||
},
|
||||
}
|
||||
}
|
||||
if drop_apples then
|
||||
table.insert(drop.items, {
|
||||
items = {"mcl_core:apple"},
|
||||
rarity = apple_chances[fortune_level + 1]
|
||||
})
|
||||
end
|
||||
return drop
|
||||
end
|
||||
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = tiles,
|
||||
paramtype = "light",
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
leaves = 1, leafdecay = leafdecay_distance, deco_block = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
compostability = 30
|
||||
},
|
||||
drop = get_drops(0),
|
||||
_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) },
|
||||
})
|
||||
end
|
||||
|
||||
local function register_sapling(subname, description, longdesc, tt_help, texture, selbox)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description,
|
||||
_tt_help = tt_help,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
visual_scale = 1.0,
|
||||
tiles = {texture},
|
||||
inventory_image = texture,
|
||||
wield_image = texture,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = selbox
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
plant = 1, sapling = 1, non_mycelium_plant = 1, attached_node = 1,
|
||||
deco_block = 1, dig_immediate = 3, dig_by_water = 1, dig_by_piston = 1,
|
||||
destroy_by_lava_flow = 1, compostability = 30
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("stage", 0)
|
||||
end,
|
||||
on_place = mcl_util.generate_on_place_plant_function(function(pos, node)
|
||||
local node_below = minetest.get_node_or_nil({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if not node_below then return false end
|
||||
local nn = node_below.name
|
||||
return minetest.get_item_group(nn, "grass_block") == 1 or
|
||||
nn == "mcl_core:podzol" or nn == "mcl_core:podzol_snow" or
|
||||
nn == "mcl_core:dirt" or nn == "mcl_core:mycelium" or nn == "mcl_core:coarse_dirt"
|
||||
end),
|
||||
node_placement_prediction = "",
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
})
|
||||
end
|
||||
|
||||
---------------------
|
||||
|
||||
register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png", "mcl_core:stripped_oak")
|
||||
register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png", "mcl_core:stripped_dark_oak")
|
||||
register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png", "mcl_core:stripped_acacia")
|
||||
register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png", "mcl_core:stripped_spruce")
|
||||
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png", "mcl_core:stripped_birch")
|
||||
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png", "mcl_core:stripped_jungle")
|
||||
|
||||
register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), S("The stripped wood of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png")
|
||||
register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), S("The stripped wood of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png")
|
||||
register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of a dark oak tree."), S("The stripped wood of a dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png")
|
||||
register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of a birch tree."), S("The stripped wood of a birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png")
|
||||
register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of a spruce tree."), S("The stripped wood of a spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png")
|
||||
register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of a jungle tree."), S("The stripped wood of a jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png")
|
||||
register_wooden_planks("wood", S("Oak Wood Planks"), {"default_wood.png"})
|
||||
register_wooden_planks("darkwood", S("Dark Oak Wood Planks"), {"mcl_core_planks_big_oak.png"})
|
||||
register_wooden_planks("junglewood", S("Jungle Wood Planks"), {"default_junglewood.png"})
|
||||
register_wooden_planks("sprucewood", S("Spruce Wood Planks"), {"mcl_core_planks_spruce.png"})
|
||||
register_wooden_planks("acaciawood", S("Acacia Wood Planks"), {"default_acacia_wood.png"})
|
||||
register_wooden_planks("birchwood", S("Birch Wood Planks"), {"mcl_core_planks_birch.png"})
|
||||
|
||||
|
||||
register_sapling("sapling", S("Oak Sapling"),
|
||||
S("When placed on soil (such as dirt) and exposed to light, an oak sapling will grow into an oak after some time."),
|
||||
S("Needs soil and light to grow"),
|
||||
"default_sapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16})
|
||||
register_sapling("darksapling", S("Dark Oak Sapling"),
|
||||
S("Dark oak saplings can grow into dark oaks, but only in groups. A lonely dark oak sapling won't grow. A group of four dark oak saplings grows into a dark oak after some time when they are placed on soil (such as dirt) in a 2×2 square and exposed to light."),
|
||||
S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings required"),
|
||||
"mcl_core_sapling_big_oak.png", {-5/16, -0.5, -5/16, 5/16, 7/16, 5/16})
|
||||
register_sapling("junglesapling", S("Jungle Sapling"),
|
||||
S("When placed on soil (such as dirt) and exposed to light, a jungle sapling will grow into a jungle tree after some time. When there are 4 jungle saplings in a 2×2 square, they will grow to a huge jungle tree."),
|
||||
S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings = large tree"),
|
||||
"default_junglesapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16})
|
||||
register_sapling("acaciasapling", S("Acacia Sapling"),
|
||||
S("When placed on soil (such as dirt) and exposed to light, an acacia sapling will grow into an acacia after some time."),
|
||||
S("Needs soil and light to grow"),
|
||||
"default_acacia_sapling.png", {-5/16, -0.5, -5/16, 5/16, 4/16, 5/16})
|
||||
register_sapling("sprucesapling", S("Spruce Sapling"),
|
||||
S("When placed on soil (such as dirt) and exposed to light, a spruce sapling will grow into a spruce after some time. When there are 4 spruce saplings in a 2×2 square, they will grow to a huge spruce."),
|
||||
S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings = large tree"),
|
||||
"mcl_core_sapling_spruce.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16})
|
||||
register_sapling("birchsapling", S("Birch Sapling"),
|
||||
S("When placed on soil (such as dirt) and exposed to light, a birch sapling will grow into a birch after some time."),
|
||||
S("Needs soil and light to grow"),
|
||||
"mcl_core_sapling_birch.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16})
|
||||
|
||||
|
||||
register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "mcl_core:sapling", true, {20, 16, 12, 10})
|
||||
register_leaves("darkleaves", S("Dark Oak Leaves"), S("Dark oak leaves are grown from dark oak trees."), {"mcl_core_leaves_big_oak.png"}, "mcl_core:darksapling", true, {20, 16, 12, 10})
|
||||
register_leaves("jungleleaves", S("Jungle Leaves"), S("Jungle leaves are grown from jungle trees."), {"default_jungleleaves.png"}, "mcl_core:junglesapling", false, {40, 26, 32, 24, 10})
|
||||
register_leaves("acacialeaves", S("Acacia Leaves"), S("Acacia leaves are grown from acacia trees."), {"default_acacia_leaves.png"}, "mcl_core:acaciasapling", false, {20, 16, 12, 10})
|
||||
register_leaves("spruceleaves", S("Spruce Leaves"), S("Spruce leaves are grown from spruce trees."), {"mcl_core_leaves_spruce.png"}, "mcl_core:sprucesapling", false, {20, 16, 12, 10})
|
||||
register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from birch trees."), {"mcl_core_leaves_birch.png"}, "mcl_core:birchsapling", false, {20, 16, 12, 10})
|
||||
|
||||
|
||||
|
||||
-- Node aliases
|
||||
|
||||
minetest.register_alias("default:acacia_tree", "mcl_core:acaciatree")
|
||||
minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves")
|
|
@ -157,8 +157,8 @@ function mcl_doors:register_door(name, def)
|
|||
local left_node = minetest.get_node(pt_left)
|
||||
|
||||
-- Set door nodes
|
||||
minetest.set_node(pt, {name=name.."_b_1", param2=p2})
|
||||
minetest.set_node(pt2, {name=name.."_t_1", param2=p2})
|
||||
minetest.set_node(pt, {name=name:gsub(":mcl_doors","mcl_doors").."_b_1", param2=p2})
|
||||
minetest.set_node(pt2, {name=name:gsub(":mcl_doors","mcl_doors").."_t_1", param2=p2})
|
||||
|
||||
if def.sounds and def.sounds.place then
|
||||
minetest.sound_play(def.sounds.place, {pos=pt}, true)
|
||||
|
@ -217,9 +217,9 @@ function mcl_doors:register_door(name, def)
|
|||
local p2 = minetest.get_node(pos).param2
|
||||
local np2 = params[p2+1]
|
||||
|
||||
minetest.swap_node(pos, {name=replace_dir, param2=np2})
|
||||
minetest.swap_node(pos, {name=replace_dir:gsub(":mcl_doors","mcl_doors"), param2=np2})
|
||||
pos.y = pos.y-dir
|
||||
minetest.swap_node(pos, {name=replace, param2=np2})
|
||||
minetest.swap_node(pos, {name=replace:gsub(":mcl_doors","mcl_doors"), param2=np2})
|
||||
|
||||
local door_switching_sound
|
||||
if meta1:get_int("is_open") == 1 then
|
||||
|
@ -265,7 +265,7 @@ function mcl_doors:register_door(name, def)
|
|||
if not def.only_redstone_can_open then
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_open_close(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2")
|
||||
on_open_close(pos, 1, name:gsub(":mcl_doors","mcl_doors").."_t_1", name:gsub(":mcl_doors","mcl_doors").."_b_2", name:gsub(":mcl_doors","mcl_doors").."_t_2")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -299,7 +299,7 @@ function mcl_doors:register_door(name, def)
|
|||
else
|
||||
minetest.add_item(bottom, name)
|
||||
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
|
||||
if minetest.get_node(bottom).name ~= name.."_b_2" and minetest.get_node(top).name == name.."_t_1" then
|
||||
if minetest.get_node(bottom).name ~= name:gsub(":mcl_doors","mcl_doors").."_b_2" and minetest.get_node(top).name == name:gsub(":mcl_doors","mcl_doors").."_t_1" then
|
||||
minetest.remove_node(top)
|
||||
end
|
||||
end
|
||||
|
@ -337,7 +337,7 @@ function mcl_doors:register_door(name, def)
|
|||
else
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_open_close(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2")
|
||||
on_open_close(pos, -1, name:gsub(":mcl_doors","mcl_doors").."_b_1", name:gsub(":mcl_doors","mcl_doors").."_t_2", name:gsub(":mcl_doors","mcl_doors").."_b_2")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -370,7 +370,7 @@ function mcl_doors:register_door(name, def)
|
|||
meta_top:set_int("rotation", 0)
|
||||
else
|
||||
local bottom = { x = top.x, y = top.y - 1, z = top.z }
|
||||
if minetest.get_node(top).name ~= name.."_t_2" and minetest.get_node(bottom).name == name.."_b_1" and oldnode.name == name.."_t_1" then
|
||||
if minetest.get_node(top).name ~= name.."_t_2" and minetest.get_node(bottom).name == name:gsub(":mcl_doors","mcl_doors").."_b_1" and oldnode.name == name:gsub(":mcl_doors","mcl_doors").."_t_1" then
|
||||
minetest.dig_node(bottom)
|
||||
end
|
||||
end
|
||||
|
@ -393,7 +393,7 @@ function mcl_doors:register_door(name, def)
|
|||
local bottom = {x=top.x,y=top.y-1,z=top.z}
|
||||
local meta_bottom = minetest_get_meta(bottom)
|
||||
meta_bottom:set_int("rotation", 1)
|
||||
node.name = name .."_b_1"
|
||||
node.name = node.name:gsub(":mcl_doors","mcl_doors").."_b_1"
|
||||
minetest.swap_node(bottom, node)
|
||||
|
||||
return true
|
||||
|
@ -409,7 +409,7 @@ function mcl_doors:register_door(name, def)
|
|||
else
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_open_close(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1")
|
||||
on_open_close(pos, 1, name:gsub(":mcl_doors","mcl_doors").."_t_2", name:gsub(":mcl_doors","mcl_doors").."_b_1", name:gsub(":mcl_doors","mcl_doors").."_t_1")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -68,11 +68,11 @@ function mcl_doors:register_trapdoor(name, def)
|
|||
-- Close
|
||||
if minetest.get_item_group(me.name, "trapdoor") == 2 then
|
||||
minetest.sound_play(def.sound_close, {pos = pos, gain = 0.3, max_hear_distance = 16}, true)
|
||||
tmp_node = {name=name, param1=me.param1, param2=me.param2}
|
||||
tmp_node = {name=name:gsub(":mcl_doors","mcl_doors"), param1=me.param1, param2=me.param2}
|
||||
-- Open
|
||||
else
|
||||
minetest.sound_play(def.sound_open, {pos = pos, gain = 0.3, max_hear_distance = 16}, true)
|
||||
tmp_node = {name=name.."_open", param1=me.param1, param2=me.param2}
|
||||
tmp_node = {name=name:gsub(":mcl_doors","mcl_doors").."_open", param1=me.param1, param2=me.param2}
|
||||
end
|
||||
minetest.set_node(pos, tmp_node)
|
||||
end
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
doors_item_wood.png
|
|
@ -0,0 +1 @@
|
|||
mcl_doors_door_wood_lower.png
|
|
@ -0,0 +1 @@
|
|||
mcl_doors_door_wood_upper.png
|
|
@ -0,0 +1 @@
|
|||
doors_trapdoor.png
|
|
@ -0,0 +1 @@
|
|||
doors_trapdoor_side.png
|
|
@ -0,0 +1 @@
|
|||
mcl_fences_fence_big_oak.png
|
|
@ -0,0 +1 @@
|
|||
mcl_fences_fence_gate_big_oak.png
|
|
@ -18,118 +18,7 @@ local propagule_allowed_nodes = {
|
|||
local propagule_water_nodes = {"mcl_mud:mud","mcl_core:dirt","mcl_core:coarse_dirt","mcl_core:clay"}
|
||||
--"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,
|
||||
})
|
||||
mcl_wood.register_wood("mangrove",{nosap=true})
|
||||
|
||||
minetest.register_node("mcl_mangrove:mangrove_roots", {
|
||||
description = "Mangrove_Roots",
|
||||
|
@ -355,57 +244,7 @@ minetest.register_node("mcl_mangrove:mangrove_mud_roots", {
|
|||
_mcl_hardness = 0.7,
|
||||
})
|
||||
|
||||
mcl_doors:register_door("mcl_mangrove:mangrove_door", {
|
||||
description = ("Mangrove Door"),
|
||||
_doc_items_longdesc = "",
|
||||
_doc_items_usagehelp = "",
|
||||
inventory_image = "mcl_mangrove_doors.png",
|
||||
groups = {handy=1,axey=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
_mcl_blast_resistance = 3,
|
||||
tiles_bottom = {"mcl_mangrove_door_bottom.png", "mcl_mangrove_planks.png"},
|
||||
tiles_top = {"mcl_mangrove_door_top.png", "mcl_mangrove_planks.png"},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
mcl_doors:register_trapdoor("mcl_mangrove:mangrove_trapdoor", {
|
||||
description = S("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_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."),
|
||||
tile_front = "mcl_mangrove_trapdoor.png",
|
||||
tile_side = "mcl_mangrove_planks.png",
|
||||
wield_image = "mcl_mangrove_trapdoor.png",
|
||||
groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
_mcl_blast_resistance = 3,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
mcl_fences.register_fence_and_fence_gate(
|
||||
"mangrove_wood_fence",
|
||||
S("Mangrove Wood Fence"),
|
||||
S("Mangrove Wood Plank Fence"),
|
||||
"mcl_mangrove_fence.png",
|
||||
{handy=1,axey=1, flammable=2,fence_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
|
||||
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
|
||||
{"group:fence_wood"},
|
||||
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_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({
|
||||
output = "mcl_mangrove:mangrove_tree_bark 3",
|
||||
|
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
@ -5,31 +5,6 @@
|
|||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local woods = {
|
||||
{ "wood", "default_wood.png", S("Oak Wood Stairs"), S("Oak Wood Slab"), S("Double Oak Wood Slab") },
|
||||
{ "junglewood", "default_junglewood.png", S("Jungle Wood Stairs"), S("Jungle Wood Slab"), S("Double Jungle Wood Slab") },
|
||||
{ "acaciawood", "default_acacia_wood.png", S("Acacia Wood Stairs"), S("Acacia Wood Slab"), S("Double Acacia Wood Slab") },
|
||||
{ "sprucewood", "mcl_core_planks_spruce.png", S("Spruce Wood Stairs"), S("Spruce Wood Slab"), S("Double Spruce Wood Slab") },
|
||||
{ "birchwood", "mcl_core_planks_birch.png", S("Birch Wood Stairs"), S("Birch Wood Slab"), S("Double Birch Wood Slab") },
|
||||
{ "darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Wood Stairs"), S("Dark Oak Wood Slab"), S("Double Dark Oak Wood Slab") },
|
||||
}
|
||||
|
||||
for w=1, #woods do
|
||||
local wood = woods[w]
|
||||
mcl_stairs.register_stair(wood[1], "mcl_core:"..wood[1],
|
||||
{handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
{wood[2]},
|
||||
wood[3],
|
||||
mcl_sounds.node_sound_wood_defaults(), 3, 2,
|
||||
"woodlike")
|
||||
mcl_stairs.register_slab(wood[1], "mcl_core:"..wood[1],
|
||||
{handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
{wood[2]},
|
||||
wood[4],
|
||||
mcl_sounds.node_sound_wood_defaults(), 3, 2,
|
||||
wood[5])
|
||||
end
|
||||
|
||||
mcl_stairs.register_stair_and_slab_simple("stone_rough", "mcl_core:stone", S("Stone Stairs"), S("Stone Slab"), S("Double Stone Slab"))
|
||||
|
||||
mcl_stairs.register_slab("stone", "mcl_core:stone_smooth",
|
||||
|
|
|
@ -0,0 +1,289 @@
|
|||
mcl_wood = {}
|
||||
-- Tree nodes: Wood, Wooden Planks, Sapling, Leaves, Stripped Wood
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local mod_screwdriver = minetest.get_modpath("screwdriver")
|
||||
|
||||
local on_rotate
|
||||
if mod_screwdriver then
|
||||
on_rotate = screwdriver.rotate_3way
|
||||
end
|
||||
|
||||
local door_longdesc = S("Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal.")
|
||||
local door_usagehelp = S("To open or close a wooden door, rightclick it or supply its lower half with a redstone signal.")
|
||||
|
||||
-- Register tree trunk (wood) and bark
|
||||
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_variant)
|
||||
minetest.register_node(":mcl_wood:"..subname, {
|
||||
description = description_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
tiles = {tile_inner, tile_inner, tile_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
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 = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_variant = stripped_variant,
|
||||
})
|
||||
|
||||
minetest.register_node(":mcl_wood:"..subname.."_bark", {
|
||||
description = description_bark,
|
||||
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of a tree trunk."),
|
||||
tiles = {tile_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_variant = stripped_variant.."_bark",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_wood:"..subname.."_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_wood:"..subname, "mcl_wood:"..subname },
|
||||
{ "mcl_wood:"..subname, "mcl_wood:"..subname },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Register stripped trunk and stripped wood
|
||||
local function register_stripped_trunk(subname, description_stripped_trunk, description_stripped_bark, longdesc, longdesc_wood, tile_stripped_inner, tile_stripped_bark)
|
||||
minetest.register_node(":mcl_wood:"..subname, {
|
||||
description = description_stripped_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
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 = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node(":mcl_wood:"..subname.."_bark", {
|
||||
description = description_stripped_bark,
|
||||
_doc_items_longdesc = longdesc_wood,
|
||||
tiles = {tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1, axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_wood:"..subname.."_bark 3",
|
||||
recipe = {
|
||||
{ "mcl_wood:"..subname, "mcl_wood:"..subname },
|
||||
{ "mcl_wood:"..subname, "mcl_wood:"..subname },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local function register_wooden_planks(subname, description, tiles)
|
||||
minetest.register_node(":mcl_wood:"..subname, {
|
||||
description = description,
|
||||
_doc_items_longdesc = doc.sub.items.temp.build,
|
||||
_doc_items_hidden = false,
|
||||
tiles = tiles,
|
||||
stack_max = 64,
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
local function register_leaves(subname, description, longdesc, tiles, sapling, drop_apples, sapling_chances, leafdecay_distance)
|
||||
if leafdecay_distance == nil then
|
||||
leafdecay_distance = 4
|
||||
end
|
||||
local apple_chances = {200, 180, 160, 120, 40}
|
||||
local stick_chances = {50, 45, 30, 35, 10}
|
||||
|
||||
local function get_drops(fortune_level)
|
||||
local drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {sapling},
|
||||
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]
|
||||
},
|
||||
}
|
||||
}
|
||||
if drop_apples then
|
||||
table.insert(drop.items, {
|
||||
items = {"mcl_core:apple"},
|
||||
rarity = apple_chances[fortune_level + 1]
|
||||
})
|
||||
end
|
||||
return drop
|
||||
end
|
||||
|
||||
minetest.register_node(":mcl_wood:"..subname, {
|
||||
description = description,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = tiles,
|
||||
paramtype = "light",
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
leaves = 1, leafdecay = leafdecay_distance, deco_block = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
compostability = 30
|
||||
},
|
||||
drop = get_drops(0),
|
||||
_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) },
|
||||
})
|
||||
end
|
||||
|
||||
local function register_sapling(subname, description, longdesc, tt_help, texture, selbox)
|
||||
minetest.register_node(":mcl_wood:"..subname, {
|
||||
description = description,
|
||||
_tt_help = tt_help,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
visual_scale = 1.0,
|
||||
tiles = {texture},
|
||||
inventory_image = texture,
|
||||
wield_image = texture,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = selbox
|
||||
},
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
plant = 1, sapling = 1, non_mycelium_plant = 1, attached_node = 1,
|
||||
deco_block = 1, dig_immediate = 3, dig_by_water = 1, dig_by_piston = 1,
|
||||
destroy_by_lava_flow = 1, compostability = 30
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("stage", 0)
|
||||
end,
|
||||
on_place = mcl_util.generate_on_place_plant_function(function(pos, node)
|
||||
local node_below = minetest.get_node_or_nil({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if not node_below then return false end
|
||||
local nn = node_below.name
|
||||
return minetest.get_item_group(nn, "grass_block") == 1 or
|
||||
nn == "mcl_core:podzol" or nn == "mcl_core:podzol_snow" or
|
||||
nn == "mcl_core:dirt" or nn == "mcl_core:mycelium" or nn == "mcl_core:coarse_dirt"
|
||||
end),
|
||||
node_placement_prediction = "",
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
})
|
||||
end
|
||||
|
||||
function readable_name(str)
|
||||
str = str:gsub("_", " ")
|
||||
return (str:gsub("^%l", string.upper))
|
||||
end
|
||||
|
||||
|
||||
function mcl_wood.register_wood(name,p)
|
||||
if not p then p = {} end
|
||||
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_stripped_trunk("tree_stripped_"..name, S("Stripped "..rname.." Log"), S("Stripped "..rname.." Wood"), S("The stripped trunk of an "..name.." tree."), S("The stripped wood of an "..name.." tree."), "mcl_wood_stripped_"..name.."_top.png", "mcl_wood_stripped_"..name..".png")
|
||||
|
||||
register_wooden_planks("wood_"..name, S(rname.." Wood Planks"), {"mcl_wood_planks_"..name..".png"})
|
||||
|
||||
if not p.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})
|
||||
|
||||
mcl_stairs.register_stair(name, "mcl_wood:"..name,
|
||||
{handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
{"mcl_wood_planks_"..name..".png"},
|
||||
S("Oak Wood Stairs"),
|
||||
mcl_sounds.node_sound_wood_defaults(), 3, 2,
|
||||
"woodlike")
|
||||
mcl_stairs.register_slab(name, "mcl_wood:"..name,
|
||||
{handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
{"mcl_wood_planks_"..name..".png"},
|
||||
S(rname.." Wood Slab"),
|
||||
mcl_sounds.node_sound_wood_defaults(), 3, 2,
|
||||
S("Double "..rname.." Wood Slab"))
|
||||
|
||||
mcl_fences.register_fence_and_fence_gate(
|
||||
name.."_wood_fence",
|
||||
S(rname.." Wood Fence"),
|
||||
S(rname.." Wood Fence"),
|
||||
"mcl_fences_fence_"..name..".png",
|
||||
{handy=1,axey=1, flammable=2,fence_wood=1, fire_encouragement=5, fire_flammability=20},
|
||||
minetest.registered_nodes["mcl_wood:wood_oak"]._mcl_hardness,
|
||||
minetest.registered_nodes["mcl_wood:wood_oak"]._mcl_blast_resistance,
|
||||
{"group:fence_wood"},
|
||||
mcl_sounds.node_sound_wood_defaults(), "doors_fencegate_open", "doors_fencegate_close", 1, 1,
|
||||
"mcl_fences_fence_gate_"..name..".png")
|
||||
|
||||
mcl_doors:register_door(":mcl_doors:door_"..name, {
|
||||
description = S(rname.." Door"),
|
||||
_doc_items_longdesc = door_longdesc,
|
||||
_doc_items_usagehelp = door_usagehelp,
|
||||
inventory_image = "mcl_doors_door_"..name..".png",
|
||||
groups = {handy=1,axey=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
_mcl_blast_resistance = 3,
|
||||
tiles_bottom = {"mcl_doors_door_"..name.."_lower.png", "mcl_wood_planks_"..name..".png"},
|
||||
tiles_top = {"mcl_doors_door_"..name.."_upper.png", "mcl_wood_planks_"..name..".png"},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
mcl_doors:register_trapdoor(":mcl_doors:trapdoor_"..name, {
|
||||
description = S(rname.." 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_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."),
|
||||
tile_front = "mcl_doors_trapdoor_"..name..".png",
|
||||
tile_side = "mcl_wood_planks_"..name..".png",
|
||||
wield_image = "mcl_doors_trapdoor_"..name..".png",
|
||||
groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
_mcl_blast_resistance = 3,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
end
|
|
@ -0,0 +1,44 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
dofile(modpath.."/api.lua")
|
||||
|
||||
for _,w in pairs({"oak","dark_oak","jungle","spruce","acacia","birch"}) do
|
||||
mcl_wood.register_wood(w)
|
||||
end
|
||||
|
||||
minetest.register_alias("default:acacia_tree", "mcl_core:acaciatree")
|
||||
minetest.register_alias("default:acacia_leaves", "mcl_core:acacialeaves")
|
||||
|
||||
minetest.register_alias("mcl_core:birchtree","mcl_wood:tree_birch")
|
||||
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:jungletree","mcl_wood:tree_jungle")
|
||||
minetest.register_alias("mcl_core:sprucetree","mcl_wood:tree_spruce")
|
||||
minetest.register_alias("mcl_core: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:darkleaves","mcl_wood:leaves_dark_oak")
|
||||
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:spruceleaves","mcl_wood:leaves_spruce")
|
||||
minetest.register_alias("mcl_core: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:big_oakwood","mcl_wood:wood_dark_oak")
|
||||
minetest.register_alias("mcl_core:acaciawood","mcl_wood:wood_acacia")
|
||||
minetest.register_alias("mcl_core:junglewood","mcl_wood:wood_jungle")
|
||||
minetest.register_alias("mcl_core:sprucewood","mcl_wood:wood_spruce")
|
||||
minetest.register_alias("mcl_core:wood","mcl_wood:wood_oak")
|
||||
minetest.register_alias("default:wood","mcl_wood:wood_oak")
|
||||
|
||||
minetest.register_alias("mcl_core:birchsapling","mcl_sapling:sapling_birch")
|
||||
minetest.register_alias("mcl_core:big_oaksapling","mcl_sapling:sapling_dark_oak")
|
||||
minetest.register_alias("mcl_core:acaciasapling","mcl_sapling:sapling_acacia")
|
||||
minetest.register_alias("mcl_core:junglesapling","mcl_sapling:sapling_jungle")
|
||||
minetest.register_alias("mcl_core:sprucesapling","mcl_sapling:sapling_spruce")
|
||||
minetest.register_alias("mcl_core:sapling","mcl_sapling:sapling_oak")
|
||||
minetest.register_alias("default:sapling","mcl_sapling:sapling_oak")
|
|
@ -0,0 +1,4 @@
|
|||
name = mcl_wood
|
||||
author = cora
|
||||
depends = mcl_autogroup, mcl_init, mcl_sounds, mcl_particles, mcl_util, mcl_worlds, doc_items, mcl_enchanting, mcl_colors, mcl_stairs
|
||||
optional_depends = doc, screwdriver
|
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 226 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 210 B |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 192 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 209 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 611 B |
After Width: | Height: | Size: 681 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 695 B |
After Width: | Height: | Size: 650 B |
After Width: | Height: | Size: 637 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 729 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 200 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 216 B |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 221 B |
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 225 B |
|
@ -3,21 +3,19 @@ local doc_mod = minetest.get_modpath("doc")
|
|||
|
||||
|
||||
local barks = {
|
||||
{ "", S("Oak Bark Stairs"), S("Oak Bark Slab"), S("Double Oak Bark Slab") },
|
||||
{ "oak", S("Oak Bark Stairs"), S("Oak Bark Slab"), S("Double Oak Bark Slab") },
|
||||
{ "jungle", S("Jungle Bark Stairs"), S("Jungle Bark Slab"), S("Double Jungle Bark Slab") },
|
||||
{ "acacia", S("Acacia Bark Stairs"), S("Acacia Bark Slab"), S("Double Acacia Bark Slab") },
|
||||
{ "spruce", S("Spruce Bark Stairs"), S("Spruce Bark Slab"), S("Double Spruce Bark Slab") },
|
||||
{ "birch", S("Birch Bark Stairs"), S("Birch Bark Slab"), S("Double Birch Bark Slab") },
|
||||
{ "dark", S("Dark Oak Bark Stairs"), S("Dark Oak Bark Slab"), S("Double Dark Oak Bark Slab") },
|
||||
{ "dark_oak", S("Dark Oak Bark Stairs"), S("Dark Oak Bark Slab"), S("Double Dark Oak Bark Slab") },
|
||||
}
|
||||
|
||||
for b=1, #barks do
|
||||
local bark = barks[b]
|
||||
local sub = bark[1].."tree_bark"
|
||||
local id = "mcl_core:tree"
|
||||
if bark[1] ~= "" then
|
||||
id = "mcl_core:"..bark[1].."tree"
|
||||
end
|
||||
local sub = "tree_"..bark[1].."_bark"
|
||||
local id = "mcl_wood:tree_"..bark[1]
|
||||
|
||||
mcl_stairs.register_stair(sub, id,
|
||||
{handy=1,axey=1, flammable=3, bark_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
{minetest.registered_nodes[id].tiles[3]},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mclx_stairs
|
||||
description = Additional stairs and slabs not found in Minecraft 1.11
|
||||
depends = mcl_ocean, mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_colorblocks, mcl_stairs
|
||||
depends = mcl_ocean, mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_colorblocks, mcl_stairs, mcl_wood
|
||||
optional_depends = doc
|
||||
|
|