2021-04-12 13:28:28 +00:00
-- Tree nodes: Wood, Wooden Planks, Sapling, Leaves, Stripped Wood
2021-05-29 14:12:33 +00:00
local S = minetest.get_translator ( minetest.get_current_modname ( ) )
local mod_screwdriver = minetest.get_modpath ( " screwdriver " )
2017-07-07 14:37:05 +00:00
2019-12-14 22:42:17 +00:00
local on_rotate
if mod_screwdriver then
on_rotate = screwdriver.rotate_3way
end
2022-12-11 19:54:29 +00:00
-- Check dug/destroyed tree trunks for orphaned leaves.
--
-- This function is meant to be called by the `after_destruct` handler of
-- treetrunk nodes.
--
-- Whenever a trunk node is removed, all `group:leaves` nodes in a sphere
-- with radius 6 are checked. Every such node that does not have a trunk
2023-02-08 16:11:38 +00:00
-- node within a distance of 6 blocks and wasn't placed by a player is
-- converted into a orphan leaf node.
2022-12-11 19:54:29 +00:00
-- An ABM will gradually decay these nodes.
--
--
-- @param pos the position of the removed trunk node.
-- @param oldnode the node table of the removed trunk node.
function mcl_core . update_leaves ( pos , oldnode )
local pos1 , pos2 = vector.offset ( pos , - 6 , - 6 , - 6 ) , vector.offset ( pos , 6 , 6 , 6 )
2023-03-19 23:46:35 +00:00
local lnode , lmeta
2022-12-11 19:54:29 +00:00
local leaves = minetest.find_nodes_in_area ( pos1 , pos2 , " group:leaves " )
for _ , lpos in pairs ( leaves ) do
lnode = minetest.get_node ( lpos )
2023-02-15 18:29:18 +00:00
lmeta = minetest.get_meta ( lpos )
2023-02-13 11:17:51 +00:00
-- skip already decaying leaf nodes and player leaves
2023-02-15 18:29:18 +00:00
if minetest.get_item_group ( lnode.name , " orphan_leaves " ) ~= 1 and lmeta : get_int ( " player_leaves " ) ~= 1 then
2022-12-11 19:54:29 +00:00
if not minetest.find_node_near ( lpos , 6 , " group:tree " ) then
2023-02-08 16:11:38 +00:00
local orphan_name = lnode.name .. " _orphan "
local def = minetest.registered_nodes [ orphan_name ]
if def then
--minetest.log("Registered: ".. orphan_name)
minetest.set_node ( lpos , { name = orphan_name } )
else
--minetest.log("Not registered: ".. orphan_name)
2022-12-11 19:54:29 +00:00
end
end
end
end
end
2023-02-10 10:39:43 +00:00
function mcl_core . make_player_leaves ( pos )
2023-02-15 18:29:18 +00:00
local meta = minetest.get_meta ( pos )
meta : set_int ( " player_leaves " , 1 )
2023-02-10 10:39:43 +00:00
end
2017-11-24 03:55:02 +00:00
-- Register tree trunk (wood) and bark
2021-06-15 17:33:04 +00:00
local function register_tree_trunk ( subname , description_trunk , description_bark , longdesc , tile_inner , tile_bark , stripped_variant )
2017-07-07 14:37:05 +00:00
minetest.register_node ( " mcl_core: " .. subname , {
2017-11-22 21:58:45 +00:00
description = description_trunk ,
2017-07-07 14:37:05 +00:00
_doc_items_longdesc = longdesc ,
_doc_items_hidden = false ,
2017-11-22 21:58:45 +00:00
tiles = { tile_inner , tile_inner , tile_bark } ,
2017-07-07 14:37:05 +00:00
paramtype2 = " facedir " ,
on_place = mcl_util.rotate_axis ,
2022-12-11 19:54:29 +00:00
after_destruct = mcl_core.update_leaves ,
2017-07-07 14:37:05 +00:00
stack_max = 64 ,
2020-04-18 21:24:42 +00:00
groups = { handy = 1 , axey = 1 , tree = 1 , flammable = 2 , building_block = 1 , material_wood = 1 , fire_encouragement = 5 , fire_flammability = 5 } ,
2017-07-07 14:37:05 +00:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
2019-12-14 22:42:17 +00:00
on_rotate = on_rotate ,
2020-04-15 11:27:29 +00:00
_mcl_blast_resistance = 2 ,
2017-07-07 14:37:05 +00:00
_mcl_hardness = 2 ,
2021-06-15 17:33:04 +00:00
_mcl_stripped_variant = stripped_variant ,
2017-07-07 14:37:05 +00:00
} )
2017-11-22 21:58:45 +00:00
minetest.register_node ( " mcl_core: " .. subname .. " _bark " , {
description = description_bark ,
2019-03-07 22:40:43 +00:00
_doc_items_longdesc = S ( " This is a decorative block surrounded by the bark of a tree trunk. " ) ,
2017-11-22 21:58:45 +00:00
tiles = { tile_bark } ,
paramtype2 = " facedir " ,
on_place = mcl_util.rotate_axis ,
stack_max = 64 ,
2020-04-18 21:24:42 +00:00
groups = { handy = 1 , axey = 1 , bark = 1 , flammable = 2 , building_block = 1 , material_wood = 1 , fire_encouragement = 5 , fire_flammability = 5 } ,
2017-11-22 21:58:45 +00:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
2018-01-31 18:36:27 +00:00
is_ground_content = false ,
2019-12-14 22:42:17 +00:00
on_rotate = on_rotate ,
2020-04-15 11:27:29 +00:00
_mcl_blast_resistance = 2 ,
2017-11-22 21:58:45 +00:00
_mcl_hardness = 2 ,
2021-06-15 17:33:04 +00:00
_mcl_stripped_variant = stripped_variant .. " _bark " ,
2017-11-22 21:58:45 +00:00
} )
2017-11-24 03:55:02 +00:00
minetest.register_craft ( {
output = " mcl_core: " .. subname .. " _bark 3 " ,
recipe = {
{ " mcl_core: " .. subname , " mcl_core: " .. subname } ,
{ " mcl_core: " .. subname , " mcl_core: " .. subname } ,
}
} )
2017-07-07 14:37:05 +00:00
end
2021-04-18 18:02:37 +00:00
-- Register stripped trunk and stripped wood
2021-06-18 19:30:20 +00:00
local function register_stripped_trunk ( subname , description_stripped_trunk , description_stripped_bark , longdesc , longdesc_wood , tile_stripped_inner , tile_stripped_bark )
2021-04-18 18:02:37 +00:00
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 ,
2021-06-18 19:30:20 +00:00
groups = { handy = 1 , axey = 1 , tree = 1 , flammable = 2 , building_block = 1 , material_wood = 1 , fire_encouragement = 5 , fire_flammability = 5 } ,
2021-04-18 18:02:37 +00:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
on_rotate = on_rotate ,
_mcl_blast_resistance = 2 ,
_mcl_hardness = 2 ,
} )
2021-04-12 13:28:28 +00:00
2021-04-18 18:02:37 +00:00
minetest.register_node ( " mcl_core: " .. subname .. " _bark " , {
description = description_stripped_bark ,
2021-06-18 19:30:20 +00:00
_doc_items_longdesc = longdesc_wood ,
2021-04-18 18:02:37 +00:00
tiles = { tile_stripped_bark } ,
paramtype2 = " facedir " ,
on_place = mcl_util.rotate_axis ,
stack_max = 64 ,
2021-06-18 19:30:20 +00:00
groups = { handy = 1 , axey = 1 , bark = 1 , flammable = 2 , building_block = 1 , material_wood = 1 , fire_encouragement = 5 , fire_flammability = 5 } ,
2021-04-18 18:02:37 +00:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
is_ground_content = false ,
on_rotate = on_rotate ,
_mcl_blast_resistance = 2 ,
_mcl_hardness = 2 ,
} )
2021-05-22 22:09:07 +00:00
2021-04-18 18:02:37 +00:00
minetest.register_craft ( {
output = " mcl_core: " .. subname .. " _bark 3 " ,
recipe = {
{ " mcl_core: " .. subname , " mcl_core: " .. subname } ,
{ " mcl_core: " .. subname , " mcl_core: " .. subname } ,
}
} )
end
2021-04-12 13:28:28 +00:00
2021-05-26 18:02:28 +00:00
local function register_wooden_planks ( subname , description , tiles )
2017-07-07 14:37:05 +00:00
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 ,
2020-04-18 21:24:42 +00:00
groups = { handy = 1 , axey = 1 , flammable = 3 , wood = 1 , building_block = 1 , material_wood = 1 , fire_encouragement = 5 , fire_flammability = 20 } ,
2017-07-07 14:37:05 +00:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
2020-04-15 11:27:29 +00:00
_mcl_blast_resistance = 3 ,
2017-07-07 14:37:05 +00:00
_mcl_hardness = 2 ,
} )
end
2023-03-09 14:24:06 +00:00
local function register_leaves ( subname , description , longdesc , tiles , color , paramtype2 , palette , sapling , drop_apples , sapling_chances , foliage_palette )
2020-11-06 12:46:52 +00:00
local apple_chances = { 200 , 180 , 160 , 120 , 40 }
local stick_chances = { 50 , 45 , 30 , 35 , 10 }
2021-05-22 22:09:07 +00:00
2020-11-06 12:46:52 +00:00
local function get_drops ( fortune_level )
local drop = {
2017-07-07 14:37:05 +00:00
max_items = 1 ,
items = {
{
2020-11-06 12:46:52 +00:00
items = { sapling } ,
rarity = sapling_chances [ fortune_level + 1 ] or sapling_chances [ fortune_level ]
2017-07-07 14:37:05 +00:00
} ,
{
2020-11-06 12:46:52 +00:00
items = { " mcl_core:stick 1 " } ,
rarity = stick_chances [ fortune_level + 1 ]
2017-07-07 14:37:05 +00:00
} ,
{
2020-11-06 12:46:52 +00:00
items = { " mcl_core:stick 2 " } ,
rarity = stick_chances [ fortune_level + 1 ]
2017-07-07 14:37:05 +00:00
} ,
}
2020-11-06 12:46:52 +00:00
}
if drop_apples then
table.insert ( drop.items , {
items = { " mcl_core:apple " } ,
rarity = apple_chances [ fortune_level + 1 ]
} )
end
return drop
2017-07-07 14:37:05 +00:00
end
2023-02-15 18:29:18 +00:00
local l_def = {
2017-07-07 14:37:05 +00:00
description = description ,
_doc_items_longdesc = longdesc ,
_doc_items_hidden = false ,
drawtype = " allfaces_optional " ,
2017-09-13 04:50:54 +00:00
waving = 2 ,
2017-07-07 14:37:05 +00:00
tiles = tiles ,
2023-02-08 16:11:38 +00:00
color = color ,
2017-07-07 14:37:05 +00:00
paramtype = " light " ,
2023-02-08 16:11:38 +00:00
paramtype2 = paramtype2 ,
2023-03-09 14:24:06 +00:00
palette = palette ,
2017-07-07 14:37:05 +00:00
stack_max = 64 ,
2021-04-12 13:09:48 +00:00
groups = {
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 10:54:51 +00:00
handy = 1 , hoey = 1 , shearsy = 1 , swordy = 1 , dig_by_piston = 1 ,
flammable = 2 , fire_encouragement = 30 , fire_flammability = 60 ,
2023-02-15 18:29:18 +00:00
leaves = 1 , deco_block = 1 , compostability = 30 , foliage_palette = foliage_palette
2021-04-12 13:09:48 +00:00
} ,
2020-11-06 12:46:52 +00:00
drop = get_drops ( 0 ) ,
2017-08-03 00:27:55 +00:00
_mcl_shears_drop = true ,
2017-07-07 14:37:05 +00:00
sounds = mcl_sounds.node_sound_leaves_defaults ( ) ,
2020-04-15 11:27:29 +00:00
_mcl_blast_resistance = 0.2 ,
2017-07-07 14:37:05 +00:00
_mcl_hardness = 0.2 ,
2020-11-02 18:09:23 +00:00
_mcl_silk_touch_drop = true ,
2020-11-06 12:46:52 +00:00
_mcl_fortune_drop = { get_drops ( 1 ) , get_drops ( 2 ) , get_drops ( 3 ) , get_drops ( 4 ) } ,
2023-02-08 16:11:38 +00:00
on_construct = function ( pos )
2023-02-10 18:40:35 +00:00
local node = minetest.get_node ( pos )
if node.param2 == 0 then
local new_node = mcl_core.get_foliage_block_type ( pos )
if new_node.param2 ~= 0 then
minetest.swap_node ( pos , new_node )
end
2023-02-08 16:11:38 +00:00
end
2023-02-10 18:40:35 +00:00
end ,
2023-02-10 10:39:43 +00:00
after_place_node = function ( pos )
2023-02-10 18:40:35 +00:00
mcl_core.make_player_leaves ( pos ) -- Leaves placed by the player should always be player leaves.
end ,
}
2022-12-11 19:54:29 +00:00
minetest.register_node ( " mcl_core: " .. subname , l_def )
local o_def = table.copy ( l_def )
o_def._doc_items_create_entry = false
o_def.groups . not_in_creative_inventory = 1
o_def.groups . orphan_leaves = 1
2023-02-15 18:29:18 +00:00
o_def._mcl_shears_drop = { " mcl_core: " .. subname }
o_def._mcl_silk_touch_drop = { " mcl_core: " .. subname }
2022-12-11 19:54:29 +00:00
minetest.register_node ( " mcl_core: " .. subname .. " _orphan " , o_def )
2017-07-07 14:37:05 +00:00
end
2021-05-26 18:02:28 +00:00
local function register_sapling ( subname , description , longdesc , tt_help , texture , selbox )
2017-07-07 14:37:05 +00:00
minetest.register_node ( " mcl_core: " .. subname , {
description = description ,
2020-03-08 02:18:47 +00:00
_tt_help = tt_help ,
2017-07-07 14:37:05 +00:00
_doc_items_longdesc = longdesc ,
_doc_items_hidden = false ,
drawtype = " plantlike " ,
2017-09-13 04:50:54 +00:00
waving = 1 ,
2017-07-07 14:37:05 +00:00
visual_scale = 1.0 ,
tiles = { texture } ,
inventory_image = texture ,
wield_image = texture ,
paramtype = " light " ,
s unlight_propagates = true ,
walkable = false ,
selection_box = {
type = " fixed " ,
fixed = selbox
} ,
stack_max = 64 ,
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 10:54:51 +00:00
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
} ,
2017-07-07 14:37:05 +00:00
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
2022-04-13 10:59:05 +00:00
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 "
2017-07-07 14:37:05 +00:00
end ) ,
node_placement_prediction = " " ,
_mcl_blast_resistance = 0 ,
_mcl_hardness = 0 ,
} )
end
---------------------
2021-04-19 16:50:21 +00:00
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 " )
2019-03-07 22:40:43 +00:00
2021-06-18 19:30:20 +00:00
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 " )
2019-03-07 22:40:43 +00:00
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 " } )
2020-03-08 02:18:47 +00:00
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 } )
2019-03-07 22:40:43 +00:00
2023-03-09 14:24:06 +00:00
register_leaves ( " leaves " , S ( " Oak Leaves " ) , S ( " Oak leaves are grown from oak trees. " ) , { " default_leaves.png " } , " #48B518 " , " color " , " mcl_core_palette_foliage.png " , " mcl_core:sapling " , true , { 20 , 16 , 12 , 10 } , 1 )
register_leaves ( " darkleaves " , S ( " Dark Oak Leaves " ) , S ( " Dark oak leaves are grown from dark oak trees. " ) , { " mcl_core_leaves_big_oak.png " } , " #48B518 " , " color " , " mcl_core_palette_foliage.png " , " mcl_core:darksapling " , true , { 20 , 16 , 12 , 10 } , 1 )
register_leaves ( " jungleleaves " , S ( " Jungle Leaves " ) , S ( " Jungle leaves are grown from jungle trees. " ) , { " default_jungleleaves.png " } , " #48B518 " , " color " , " mcl_core_palette_foliage.png " , " mcl_core:junglesapling " , false , { 40 , 26 , 32 , 24 , 10 } , 1 )
register_leaves ( " acacialeaves " , S ( " Acacia Leaves " ) , S ( " Acacia leaves are grown from acacia trees. " ) , { " default_acacia_leaves.png " } , " #48B518 " , " color " , " mcl_core_palette_foliage.png " , " mcl_core:acaciasapling " , false , { 20 , 16 , 12 , 10 } , 1 )
register_leaves ( " spruceleaves " , S ( " Spruce Leaves " ) , S ( " Spruce leaves are grown from spruce trees. " ) , { " mcl_core_leaves_spruce.png " } , " #619961 " , " none " , nil , " mcl_core:sprucesapling " , false , { 20 , 16 , 12 , 10 } , 0 )
register_leaves ( " birchleaves " , S ( " Birch Leaves " ) , S ( " Birch leaves are grown from birch trees. " ) , { " mcl_core_leaves_birch.png " } , " #80A755 " , " none " , nil , " mcl_core:birchsapling " , false , { 20 , 16 , 12 , 10 } , 0 )
2020-11-06 12:46:52 +00:00
2017-07-07 14:37:05 +00:00
-- Node aliases
minetest.register_alias ( " default:acacia_tree " , " mcl_core:acaciatree " )
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 10:54:51 +00:00
minetest.register_alias ( " default:acacia_leaves " , " mcl_core:acacialeaves " )