2020-08-26 02:11:54 +02:00
|
|
|
local S = minetest.get_translator("moretrees")
|
2014-03-12 22:24:42 +01:00
|
|
|
|
2013-01-20 22:15:54 +01:00
|
|
|
moretrees.avoidnodes = {}
|
2017-12-30 16:21:26 +01:00
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
local jungle_sapling_texture = minetest.get_modpath("default") and "default_junglesapling.png"
|
|
|
|
or "moretrees_cedar_sapling.png"
|
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
moretrees.treelist = {
|
2020-08-26 02:11:54 +02:00
|
|
|
{"beech", S("Beech Tree")},
|
|
|
|
{"apple_tree", S("Apple Tree")},
|
2022-10-25 01:09:19 +02:00
|
|
|
{"oak", S("Oak Tree"), "acorn", S("Acorn"), {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
2020-08-26 02:11:54 +02:00
|
|
|
{"sequoia", S("Giant Sequoia")},
|
|
|
|
{"birch", S("Birch Tree")},
|
2022-10-25 01:09:19 +02:00
|
|
|
{"palm", S("Palm Tree"), "palm_fruit_trunk_gen", S("Palm Tree"), {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 },
|
|
|
|
{"date_palm", S("Date Palm Tree"), "date_palm_fruit_trunk",S("Date Palm Tree"), {0, 0, 0, 0, 0, 0}, 0.0 },
|
|
|
|
{"spruce", S("Spruce Tree"), "spruce_cone", S("Spruce Cone"), {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
|
|
|
{"cedar", S("Cedar Tree"), "cedar_cone", S("Cedar Cone"), {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
2020-08-26 02:11:54 +02:00
|
|
|
{"poplar", S("Poplar Tree")},
|
|
|
|
{"poplar_small", S("Poplar Tree")},
|
|
|
|
{"willow", S("Willow Tree")},
|
|
|
|
{"rubber_tree", S("Rubber Tree")},
|
2022-10-25 01:09:19 +02:00
|
|
|
{"fir", S("Douglas Fir"), "fir_cone", S("Fir Cone"), {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
2024-05-26 17:08:14 +02:00
|
|
|
{"jungletree", S("Jungle Tree"), nil, nil, nil, nil, jungle_sapling_texture },
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
|
|
|
|
2020-08-26 02:11:54 +02:00
|
|
|
moretrees.treedesc = {
|
|
|
|
beech = {
|
|
|
|
trunk = S("Beech Tree Trunk"),
|
|
|
|
planks = S("Beech Tree Planks"),
|
|
|
|
sapling = S("Beech Tree Sapling"),
|
|
|
|
leaves = S("Beech Tree Leaves"),
|
|
|
|
trunk_stair = S("Beech Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Beech Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Beech Tree Planks Stair"),
|
|
|
|
planks_slab = S("Beech Tree Planks Slab"),
|
|
|
|
fence = S("Beech Tree Fence"),
|
|
|
|
fence_rail = S("Beech Tree Fence Rail"),
|
|
|
|
fence_gate = S("Beech Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
apple_tree = {
|
|
|
|
trunk = S("Apple Tree Trunk"),
|
|
|
|
planks = S("Apple Tree Planks"),
|
|
|
|
sapling = S("Apple Tree Sapling"),
|
|
|
|
leaves = S("Apple Tree Leaves"),
|
|
|
|
trunk_stair = S("Apple Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Apple Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Apple Tree Planks Stair"),
|
|
|
|
planks_slab = S("Apple Tree Planks Slab"),
|
|
|
|
fence = S("Apple Tree Fence"),
|
|
|
|
fence_rail = S("Apple Tree Fence Rail"),
|
|
|
|
fence_gate = S("Apple Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
oak = {
|
|
|
|
trunk = S("Oak Tree Trunk"),
|
|
|
|
planks = S("Oak Tree Planks"),
|
|
|
|
sapling = S("Oak Tree Sapling"),
|
|
|
|
leaves = S("Oak Tree Leaves"),
|
|
|
|
trunk_stair = S("Oak Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Oak Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Oak Tree Planks Stair"),
|
|
|
|
planks_slab = S("Oak Tree Planks Slab"),
|
|
|
|
fence = S("Oak Tree Fence"),
|
|
|
|
fence_rail = S("Oak Tree Fence Rail"),
|
|
|
|
fence_gate = S("Oak Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
sequoia = {
|
|
|
|
trunk = S("Giant Sequoia Trunk"),
|
|
|
|
planks = S("Giant Sequoia Planks"),
|
|
|
|
sapling = S("Giant Sequoia Sapling"),
|
|
|
|
leaves = S("Giant Sequoia Leaves"),
|
|
|
|
trunk_stair = S("Giant Sequoia Trunk Stair"),
|
|
|
|
trunk_slab = S("Giant Sequoia Trunk Slab"),
|
|
|
|
planks_stair = S("Giant Sequoia Planks Stair"),
|
|
|
|
planks_slab = S("Giant Sequoia Planks Slab"),
|
|
|
|
fence = S("Giant Sequoia Fence"),
|
|
|
|
fence_rail = S("Giant Sequoia Fence Rail"),
|
|
|
|
fence_gate = S("Giant Sequoia Fence Gate"),
|
|
|
|
},
|
|
|
|
birch = {
|
|
|
|
trunk = S("Birch Tree Trunk"),
|
|
|
|
planks = S("Birch Tree Planks"),
|
|
|
|
sapling = S("Birch Tree Sapling"),
|
|
|
|
leaves = S("Birch Tree Leaves"),
|
|
|
|
trunk_stair = S("Birch Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Birch Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Birch Tree Planks Stair"),
|
|
|
|
planks_slab = S("Birch Tree Planks Slab"),
|
|
|
|
fence = S("Birch Tree Fence"),
|
|
|
|
fence_rail = S("Birch Tree Fence Rail"),
|
|
|
|
fence_gate = S("Birch Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
palm = {
|
|
|
|
trunk = S("Palm Tree Trunk"),
|
|
|
|
planks = S("Palm Tree Planks"),
|
|
|
|
sapling = S("Palm Tree Sapling"),
|
|
|
|
leaves = S("Palm Tree Leaves"),
|
|
|
|
trunk_stair = S("Palm Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Palm Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Palm Tree Planks Stair"),
|
|
|
|
planks_slab = S("Palm Tree Planks Slab"),
|
|
|
|
fence = S("Palm Tree Fence"),
|
|
|
|
fence_rail = S("Palm Tree Fence Rail"),
|
|
|
|
fence_gate = S("Palm Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
date_palm = {
|
|
|
|
trunk = S("Date Palm Tree Trunk"),
|
|
|
|
planks = S("Date Palm Tree Planks"),
|
|
|
|
sapling = S("Date Palm Tree Sapling"),
|
|
|
|
leaves = S("Date Palm Tree Leaves"),
|
|
|
|
trunk_stair = S("Date Palm Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Date Palm Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Date Palm Tree Planks Stair"),
|
|
|
|
planks_slab = S("Date Palm Tree Planks Slab"),
|
|
|
|
fence = S("Date Palm Tree Fence"),
|
|
|
|
fence_rail = S("Date Palm Tree Fence Rail"),
|
|
|
|
fence_gate = S("Date Palm Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
spruce = {
|
|
|
|
trunk = S("Spruce Tree Trunk"),
|
|
|
|
planks = S("Spruce Tree Planks"),
|
|
|
|
sapling = S("Spruce Tree Sapling"),
|
|
|
|
leaves = S("Spruce Tree Leaves"),
|
|
|
|
trunk_stair = S("Spruce Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Spruce Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Spruce Tree Planks Stair"),
|
|
|
|
planks_slab = S("Spruce Tree Planks Slab"),
|
|
|
|
fence = S("Spruce Tree Fence"),
|
|
|
|
fence_rail = S("Spruce Tree Fence Rail"),
|
|
|
|
fence_gate = S("Spruce Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
cedar = {
|
|
|
|
trunk = S("Cedar Tree Trunk"),
|
|
|
|
planks = S("Cedar Tree Planks"),
|
|
|
|
sapling = S("Cedar Tree Sapling"),
|
|
|
|
leaves = S("Cedar Tree Leaves"),
|
|
|
|
trunk_stair = S("Cedar Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Cedar Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Cedar Tree Planks Stair"),
|
|
|
|
planks_slab = S("Cedar Tree Planks Slab"),
|
|
|
|
fence = S("Cedar Tree Fence"),
|
|
|
|
fence_rail = S("Cedar Tree Fence Rail"),
|
|
|
|
fence_gate = S("Cedar Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
poplar = {
|
|
|
|
trunk = S("Poplar Tree Trunk"),
|
|
|
|
planks = S("Poplar Tree Planks"),
|
|
|
|
sapling = S("Poplar Tree Sapling"),
|
|
|
|
leaves = S("Poplar Tree Leaves"),
|
|
|
|
trunk_stair = S("Poplar Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Poplar Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Poplar Tree Planks Stair"),
|
|
|
|
planks_slab = S("Poplar Tree Planks Slab"),
|
|
|
|
fence = S("Poplar Tree Fence"),
|
|
|
|
fence_rail = S("Poplar Tree Fence Rail"),
|
|
|
|
fence_gate = S("Poplar Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
poplar_small = {
|
|
|
|
sapling = S("Small poplar Tree Sapling"),
|
|
|
|
},
|
|
|
|
willow = {
|
|
|
|
trunk = S("Willow Tree Trunk"),
|
|
|
|
planks = S("Willow Tree Planks"),
|
|
|
|
sapling = S("Willow Tree Sapling"),
|
|
|
|
leaves = S("Willow Tree Leaves"),
|
|
|
|
trunk_stair = S("Willow Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Willow Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Willow Tree Planks Stair"),
|
|
|
|
planks_slab = S("Willow Tree Planks Slab"),
|
|
|
|
fence = S("Willow Tree Fence"),
|
|
|
|
fence_rail = S("Willow Tree Fence Rail"),
|
|
|
|
fence_gate = S("Willow Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
rubber_tree = {
|
|
|
|
trunk = S("Rubber Tree Trunk"),
|
|
|
|
planks = S("Rubber Tree Planks"),
|
|
|
|
sapling = S("Rubber Tree Sapling"),
|
|
|
|
leaves = S("Rubber Tree Leaves"),
|
|
|
|
trunk_stair = S("Rubber Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Rubber Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Rubber Tree Planks Stair"),
|
|
|
|
planks_slab = S("Rubber Tree Planks Slab"),
|
|
|
|
fence = S("Rubber Tree Fence"),
|
|
|
|
fence_rail = S("Rubber Tree Fence Rail"),
|
|
|
|
fence_gate = S("Rubber Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
fir = {
|
|
|
|
trunk = S("Douglas Fir Trunk"),
|
|
|
|
planks = S("Douglas Fir Planks"),
|
|
|
|
sapling = S("Douglas Fir Sapling"),
|
|
|
|
leaves = S("Douglas Fir Leaves"),
|
|
|
|
trunk_stair = S("Douglas Fir Trunk Stair"),
|
|
|
|
trunk_slab = S("Douglas Fir Trunk Slab"),
|
|
|
|
planks_stair = S("Douglas Fir Planks Stair"),
|
|
|
|
planks_slab = S("Douglas Fir Planks Slab"),
|
|
|
|
fence = S("Douglas Fir Fence"),
|
|
|
|
fence_rail = S("Douglas Fir Fence Rail"),
|
|
|
|
fence_gate = S("Douglas Fir Fence Gate"),
|
|
|
|
},
|
|
|
|
jungletree = {
|
|
|
|
trunk = S("Jungle Tree Trunk"),
|
|
|
|
planks = S("Jungle Tree Planks"),
|
|
|
|
sapling = S("Jungle Tree Sapling"),
|
|
|
|
leaves = S("Jungle Tree Leaves"),
|
|
|
|
trunk_stair = S("Jungle Tree Trunk Stair"),
|
|
|
|
trunk_slab = S("Jungle Tree Trunk Slab"),
|
|
|
|
planks_stair = S("Jungle Tree Planks Stair"),
|
|
|
|
planks_slab = S("Jungle Tree Planks Slab"),
|
|
|
|
fence = S("Jungle Tree Fence"),
|
|
|
|
fence_rail = S("Jungle Tree Fence Rail"),
|
|
|
|
fence_gate = S("Jungle Tree Fence Gate"),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-- local dirs1 = { 21, 20, 23, 22, 21 }
|
2013-04-24 14:43:27 +02:00
|
|
|
local dirs2 = { 12, 9, 18, 7, 12 }
|
2020-08-26 02:11:54 +02:00
|
|
|
-- local dirs3 = { 14, 11, 16, 5, 14 }
|
2013-04-24 14:43:27 +02:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_new_leaves_drawtype = "allfaces_optional"
|
|
|
|
local moretrees_plantlike_leaves_visual_scale = 1
|
|
|
|
|
2017-12-30 16:21:26 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
2013-11-15 00:05:37 +01:00
|
|
|
moretrees_new_leaves_drawtype = "plantlike"
|
2017-02-10 15:48:20 +01:00
|
|
|
moretrees_plantlike_leaves_visual_scale = math.sqrt(2)
|
2013-11-15 00:05:37 +01:00
|
|
|
end
|
|
|
|
|
2014-07-30 20:53:27 +02:00
|
|
|
-- redefine default leaves to handle plantlike and/or leaf decay options
|
2013-11-23 05:51:42 +01:00
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
if minetest.get_modpath("default") and moretrees.plantlike_leaves then
|
|
|
|
minetest.override_item(xcompat.materials.apple_leaves, {
|
2014-07-30 20:53:27 +02:00
|
|
|
inventory_image = minetest.inventorycube("default_leaves.png"),
|
|
|
|
drawtype = "plantlike",
|
2017-02-10 15:48:20 +01:00
|
|
|
visual_scale = math.sqrt(2)
|
2014-07-30 20:53:27 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
-- redefine default jungle leaves for same
|
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
if minetest.get_modpath("default") and moretrees.plantlike_leaves then
|
|
|
|
minetest.override_item(xcompat.materials.jungle_leaves, {
|
2014-07-30 20:53:27 +02:00
|
|
|
inventory_image = minetest.inventorycube("default_jungleleaves.png"),
|
|
|
|
drawtype = "plantlike",
|
2017-02-10 15:48:20 +01:00
|
|
|
visual_scale = math.sqrt(2)
|
2014-07-30 20:53:27 +02:00
|
|
|
})
|
|
|
|
end
|
2013-11-15 00:05:37 +01:00
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
for i in ipairs(moretrees.treelist) do
|
|
|
|
local treename = moretrees.treelist[i][1]
|
|
|
|
local fruit = moretrees.treelist[i][3]
|
|
|
|
local fruitdesc = moretrees.treelist[i][4]
|
|
|
|
local selbox = moretrees.treelist[i][5]
|
|
|
|
local vscale = moretrees.treelist[i][6]
|
2015-08-15 22:59:11 +02:00
|
|
|
|
|
|
|
local saptex = moretrees.treelist[i][7]
|
2013-02-11 06:09:53 +01:00
|
|
|
|
2017-03-15 01:26:59 +01:00
|
|
|
-- player will get a sapling with 1/100 chance
|
|
|
|
-- player will get leaves only if he/she gets no saplings,
|
|
|
|
-- this is because max_items is 1
|
|
|
|
|
|
|
|
local droprarity = 100
|
|
|
|
local decay = moretrees.leafdecay_radius
|
|
|
|
|
|
|
|
if treename == "palm" then
|
|
|
|
droprarity = 20
|
|
|
|
decay = moretrees.palm_leafdecay_radius
|
|
|
|
elseif treename == "date_palm" then
|
2022-06-01 09:02:34 +02:00
|
|
|
decay = moretrees.date_palm_leafdecay_radius
|
2017-03-15 01:26:59 +01:00
|
|
|
end
|
|
|
|
|
2022-11-06 03:20:28 +01:00
|
|
|
-- dont register planks/nodes for trees from default and small varients for trees
|
|
|
|
local split_tn = treename:split("_")
|
|
|
|
if treename ~= "jungletree" and treename ~= "pine" and split_tn[2]~="small" then
|
2013-03-19 22:01:09 +01:00
|
|
|
|
2015-08-15 22:59:11 +02:00
|
|
|
saptex = "moretrees_"..treename.."_sapling.png"
|
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_trunk", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].trunk,
|
2013-03-19 22:01:09 +01:00
|
|
|
tiles = {
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
2013-04-24 14:43:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2013-03-19 22:01:09 +01:00
|
|
|
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_wood_defaults(),
|
2014-01-30 22:09:23 +01:00
|
|
|
on_place = minetest.rotate_node,
|
2013-03-19 22:01:09 +01:00
|
|
|
})
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2024-05-27 16:25:10 +02:00
|
|
|
if moretrees.enable_planks then
|
|
|
|
minetest.register_node("moretrees:"..treename.."_planks", {
|
|
|
|
description = moretrees.treedesc[treename].planks,
|
|
|
|
tiles = {"moretrees_"..treename.."_wood.png"},
|
|
|
|
is_ground_content = false,
|
|
|
|
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
|
|
|
sounds = xcompat.sounds.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
end
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
local moretrees_new_leaves_waving = nil
|
2013-11-22 00:40:55 +01:00
|
|
|
|
2013-11-15 02:39:07 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
2013-11-16 23:38:46 +01:00
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_"..treename.."_leaves.png")
|
2013-11-27 08:48:43 +01:00
|
|
|
else
|
|
|
|
moretrees_new_leaves_waving = 1
|
2013-11-15 02:39:07 +01:00
|
|
|
end
|
|
|
|
|
2013-03-19 22:01:09 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_leaves", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].leaves,
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2014-12-19 03:35:00 +01:00
|
|
|
tiles = { "moretrees_"..treename.."_leaves.png" },
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-03-19 22:01:09 +01:00
|
|
|
paramtype = "light",
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2017-03-15 01:26:59 +01:00
|
|
|
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 1},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_leaves_defaults(),
|
2013-03-19 22:01:09 +01:00
|
|
|
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2013-10-02 19:43:50 +02:00
|
|
|
{items = {"moretrees:"..treename.."_sapling"}, rarity = droprarity },
|
2013-03-19 22:01:09 +01:00
|
|
|
{items = {"moretrees:"..treename.."_leaves"} }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
2013-04-08 04:22:01 +02:00
|
|
|
|
2015-07-19 22:00:30 +02:00
|
|
|
if moretrees.enable_stairs then
|
|
|
|
if minetest.get_modpath("moreblocks") then
|
|
|
|
|
|
|
|
-- stairsplus:register_all(modname, subname, recipeitem, {fields})
|
|
|
|
|
|
|
|
stairsplus:register_all(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_trunk",
|
2017-12-30 16:21:26 +01:00
|
|
|
"moretrees:"..treename.."_trunk",
|
2015-07-19 22:00:30 +02:00
|
|
|
{
|
|
|
|
groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 },
|
|
|
|
tiles = {
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].trunk,
|
2015-07-19 22:00:30 +02:00
|
|
|
drop = treename.."_trunk",
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2024-05-27 16:25:10 +02:00
|
|
|
if moretrees.enable_planks then
|
|
|
|
stairsplus:register_all(
|
|
|
|
"moretrees",
|
|
|
|
treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{
|
|
|
|
groups = { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1 },
|
|
|
|
tiles = { "moretrees_"..treename.."_wood.png" },
|
|
|
|
description = moretrees.treedesc[treename].planks,
|
|
|
|
drop = treename.."_planks",
|
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
2015-07-19 22:00:30 +02:00
|
|
|
elseif minetest.get_modpath("stairs") then
|
|
|
|
stairs.register_stair_and_slab(
|
|
|
|
"moretrees_"..treename.."_trunk",
|
|
|
|
"moretrees:"..treename.."_trunk",
|
|
|
|
{ snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2 },
|
|
|
|
{ "moretrees_"..treename.."_trunk_top.png",
|
2014-06-16 11:25:46 +02:00
|
|
|
"moretrees_"..treename.."_trunk_top.png",
|
|
|
|
"moretrees_"..treename.."_trunk.png"
|
|
|
|
},
|
2020-08-26 02:11:54 +02:00
|
|
|
moretrees.treedesc[treename].trunk_stair,
|
|
|
|
moretrees.treedesc[treename].trunk_slab,
|
2024-05-26 17:08:14 +02:00
|
|
|
xcompat.sounds.node_sound_wood_defaults()
|
2015-07-19 22:00:30 +02:00
|
|
|
)
|
|
|
|
|
2024-05-27 16:25:10 +02:00
|
|
|
if moretrees.enable_planks then
|
|
|
|
stairs.register_stair_and_slab(
|
|
|
|
"moretrees_"..treename.."_planks",
|
|
|
|
"moretrees:"..treename.."_planks",
|
|
|
|
{ snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3 },
|
|
|
|
{ "moretrees_"..treename.."_wood.png" },
|
|
|
|
moretrees.treedesc[treename].planks_stair,
|
|
|
|
moretrees.treedesc[treename].planks_slab,
|
|
|
|
xcompat.sounds.node_sound_wood_defaults()
|
|
|
|
)
|
|
|
|
end
|
2015-07-19 22:00:30 +02:00
|
|
|
|
|
|
|
end
|
2013-07-22 09:55:12 +02:00
|
|
|
end
|
2019-10-03 20:13:57 +02:00
|
|
|
|
2024-05-27 16:25:10 +02:00
|
|
|
if minetest.get_modpath("default") and moretrees.enable_fences and moretrees.enable_planks then
|
2019-10-03 20:13:57 +02:00
|
|
|
local planks_name = "moretrees:" .. treename .. "_planks"
|
|
|
|
local planks_tile = "moretrees_" .. treename .. "_wood.png"
|
|
|
|
default.register_fence("moretrees:" .. treename .. "_fence", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].fence,
|
2019-10-03 20:13:57 +02:00
|
|
|
texture = planks_tile,
|
|
|
|
inventory_image = "default_fence_overlay.png^" .. planks_tile ..
|
|
|
|
"^default_fence_overlay.png^[makealpha:255,126,126",
|
|
|
|
wield_image = "default_fence_overlay.png^" .. planks_tile ..
|
|
|
|
"^default_fence_overlay.png^[makealpha:255,126,126",
|
|
|
|
material = planks_name,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_wood_defaults()
|
2019-10-03 20:13:57 +02:00
|
|
|
})
|
|
|
|
default.register_fence_rail("moretrees:" .. treename .. "_fence_rail", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].fence_rail,
|
2019-10-03 20:13:57 +02:00
|
|
|
texture = planks_tile,
|
|
|
|
inventory_image = "default_fence_rail_overlay.png^" .. planks_tile ..
|
|
|
|
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
|
|
|
|
wield_image = "default_fence_rail_overlay.png^" .. planks_tile ..
|
|
|
|
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
|
|
|
|
material = planks_name,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_wood_defaults()
|
2019-10-03 20:13:57 +02:00
|
|
|
})
|
|
|
|
if minetest.global_exists("doors") then
|
|
|
|
doors.register_fencegate("moretrees:" .. treename .. "_gate", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = moretrees.treedesc[treename].fence_gate,
|
2019-10-03 20:13:57 +02:00
|
|
|
texture = planks_tile,
|
|
|
|
material = planks_name,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
2013-03-19 22:01:09 +01:00
|
|
|
end
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2022-11-06 03:20:28 +01:00
|
|
|
-- the default game provides jungle tree and pine saplings.
|
|
|
|
if treename~="jungletree" and treename ~= "pine" then
|
2022-11-06 19:39:56 +01:00
|
|
|
local regular_groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}
|
|
|
|
if minetest.settings:get_bool("creative_mode", false) then
|
|
|
|
regular_groups["not_in_creative_inventory"]=1
|
|
|
|
end
|
|
|
|
|
2022-11-06 03:20:28 +01:00
|
|
|
minetest.register_node("moretrees:"..treename.."_sapling", {
|
|
|
|
description = moretrees.treedesc[treename].sapling,
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {split_tn[2] and split_tn[2]=="small" and "moretrees_" .. treename .. "_sapling.png" or saptex},
|
|
|
|
inventory_image = split_tn[2] and split_tn[2]=="small" and "moretrees_" .. treename .. "_sapling.png" or saptex,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "waving",
|
|
|
|
walkable = false,
|
|
|
|
is_ground_content = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
|
|
|
},
|
2022-11-06 19:39:56 +01:00
|
|
|
groups = regular_groups,
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_default(),
|
2022-11-06 03:20:28 +01:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
|
|
|
|
"moretrees:" ..treename.. "_sapling",
|
|
|
|
-- minp, maxp to be checked, relative to sapling pos
|
|
|
|
-- minp_relative.y = 1 because sapling pos has been checked
|
|
|
|
{x = -3, y = 1, z = -3},
|
|
|
|
{x = 3, y = 6, z = 3},
|
|
|
|
-- maximum interval of interior volume check
|
|
|
|
4)
|
|
|
|
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.get_node_timer(pos):start(300)
|
|
|
|
end,
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
if moretrees.can_grow(pos, treename) then
|
|
|
|
--moretrees["grow_" .. treename](pos)
|
|
|
|
minetest.set_node(pos, {name="air"})
|
|
|
|
if type(moretrees["spawn_" .. treename .. "_object"])=="string" then
|
|
|
|
local split = moretrees["spawn_" .. treename .. "_object"]:split(".")
|
|
|
|
moretrees[split[2]](pos)
|
|
|
|
else
|
|
|
|
minetest.spawn_tree(pos, moretrees["spawn_" .. treename .. "_object"])
|
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.get_node_timer(pos):start(300)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2024-01-12 18:08:54 +01:00
|
|
|
local ongen_groups = {
|
|
|
|
snappy = 2,
|
|
|
|
dig_immediate = 3,
|
|
|
|
flammable = 2,
|
|
|
|
attached_node = 1,
|
|
|
|
sapling = 1,
|
|
|
|
moretrees_ongen = 1,
|
|
|
|
not_in_creative_inventory = 1
|
|
|
|
}
|
2022-11-06 19:39:56 +01:00
|
|
|
if minetest.settings:get_bool("creative_mode", false) then
|
|
|
|
ongen_groups["not_in_creative_inventory"]=nil
|
|
|
|
end
|
2015-08-14 17:50:34 +02:00
|
|
|
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = S("@1 (fast growth)", moretrees.treedesc[treename].sapling),
|
2015-08-14 17:50:34 +02:00
|
|
|
drawtype = "plantlike",
|
2022-11-06 03:20:28 +01:00
|
|
|
tiles = {split_tn[2] and split_tn[2]=="small" and "moretrees_" .. treename .. "_sapling.png" or saptex,},
|
|
|
|
inventory_image = split_tn[2] and split_tn[2]=="small" and "moretrees_" .. treename .. "_sapling.png" or saptex,
|
2015-08-14 17:50:34 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "waving",
|
|
|
|
walkable = false,
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = true,
|
2015-08-14 17:50:34 +02:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
|
|
|
},
|
2022-11-06 19:39:56 +01:00
|
|
|
groups = ongen_groups,
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_default(),
|
2020-04-23 00:09:04 +02:00
|
|
|
drop = "moretrees:"..treename.."_sapling",
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2022-10-25 01:09:19 +02:00
|
|
|
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
|
|
|
|
"moretrees:" ..treename.. "_sapling_ongen",
|
|
|
|
-- minp, maxp to be checked, relative to sapling pos
|
|
|
|
-- minp_relative.y = 1 because sapling pos has been checked
|
|
|
|
{x = -3, y = 1, z = -3},
|
|
|
|
{x = 3, y = 6, z = 3},
|
|
|
|
-- maximum interval of interior volume check
|
|
|
|
4)
|
|
|
|
|
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.get_node_timer(pos):start(2)
|
|
|
|
end,
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
if moretrees.can_grow(pos, treename) then
|
|
|
|
--moretrees["grow_" .. treename](pos)
|
|
|
|
minetest.set_node(pos, {name="air"})
|
|
|
|
if type(moretrees["spawn_" .. treename .. "_object"])=="string" then
|
|
|
|
local split = moretrees["spawn_" .. treename .. "_object"]:split(".")
|
|
|
|
moretrees[split[2]](pos)
|
|
|
|
else
|
|
|
|
minetest.spawn_tree(pos, moretrees["spawn_" .. treename .. "_object"])
|
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.get_node_timer(pos):start(300)
|
|
|
|
end
|
|
|
|
end,
|
2015-08-14 17:50:34 +02:00
|
|
|
})
|
|
|
|
|
2017-03-15 01:26:59 +01:00
|
|
|
local fruitname = nil
|
2013-12-15 19:30:17 +01:00
|
|
|
if fruit then
|
2017-03-15 01:26:59 +01:00
|
|
|
fruitname = "moretrees:"..fruit
|
|
|
|
minetest.register_node(fruitname, {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = fruitdesc,
|
2013-01-20 00:36:13 +01:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = { "moretrees_"..fruit..".png" },
|
2013-01-25 05:22:46 +01:00
|
|
|
inventory_image = "moretrees_"..fruit..".png^[transformR180",
|
|
|
|
wield_image = "moretrees_"..fruit..".png^[transformR180",
|
|
|
|
visual_scale = vscale,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2013-01-20 00:36:13 +01:00
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = selbox
|
|
|
|
},
|
2017-03-15 01:26:59 +01:00
|
|
|
groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1, leafdecay = 1, leafdecay_drop = 1},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_default(),
|
2022-12-27 21:20:39 +01:00
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
if placer:is_player() then
|
|
|
|
minetest.set_node(pos, {name = "moretrees:"..fruit, param2 = 1})
|
|
|
|
end
|
|
|
|
end
|
2013-01-20 00:36:13 +01:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-03-15 01:26:59 +01:00
|
|
|
if treename ~= "jungletree"
|
|
|
|
and treename ~= "poplar_small"
|
2024-05-26 17:08:14 +02:00
|
|
|
and treename ~= "pine"
|
|
|
|
and minetest.get_modpath("default") then
|
2017-03-15 01:26:59 +01:00
|
|
|
default.register_leafdecay({
|
|
|
|
trunks = { "moretrees:"..treename.."_trunk" },
|
|
|
|
leaves = { "moretrees:"..treename.."_leaves", fruitname },
|
|
|
|
radius = decay,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-04-24 14:43:27 +02:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "moretrees:"..treename.."_trunk_sideways" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
2020-08-26 02:11:18 +02:00
|
|
|
local nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "moretrees:"..treename.."_trunk", param2 = nfdir})
|
2013-04-24 14:43:27 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2013-01-25 05:22:46 +01:00
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_trunk")
|
2013-09-15 04:44:32 +02:00
|
|
|
|
|
|
|
if moretrees.spawn_saplings then
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_sapling")
|
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_sapling_ongen")
|
|
|
|
end
|
2013-01-25 05:22:46 +01:00
|
|
|
end
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2022-11-06 03:20:28 +01:00
|
|
|
-- poplar saplings leaves
|
2016-07-01 16:06:29 +02:00
|
|
|
local poplar_leaves_drop = minetest.registered_nodes["moretrees:poplar_leaves"].drop
|
|
|
|
minetest.override_item("moretrees:poplar_leaves", {
|
|
|
|
drop = {
|
2022-08-26 02:15:31 +02:00
|
|
|
max_items = poplar_leaves_drop.max_items,
|
2016-07-01 16:06:29 +02:00
|
|
|
items = {
|
|
|
|
{items = {"moretrees:poplar_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
|
|
|
|
{items = {"moretrees:poplar_small_sapling"}, rarity = 1.33 * poplar_leaves_drop.items[1].rarity },
|
|
|
|
{items = {"moretrees:poplar_leaves"} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
-- Extra nodes for jungle trees:
|
|
|
|
|
2015-08-14 17:50:34 +02:00
|
|
|
local jungleleaves = {"yellow","red"}
|
2020-08-26 02:11:54 +02:00
|
|
|
local jungleleavesnames = {S("Yellow"), S("Red")}
|
2015-08-14 17:50:34 +02:00
|
|
|
for color = 1, #jungleleaves do
|
2013-01-25 05:22:46 +01:00
|
|
|
local leave_name = "moretrees:jungletree_leaves_"..jungleleaves[color]
|
2013-11-16 23:38:46 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
|
2013-11-16 23:38:46 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_jungletree_leaves_"..jungleleaves[color]..".png")
|
2013-12-25 10:20:51 +01:00
|
|
|
else
|
|
|
|
moretrees_new_leaves_waving = 1
|
2013-11-16 23:38:46 +01:00
|
|
|
end
|
|
|
|
|
2013-01-20 00:36:13 +01:00
|
|
|
minetest.register_node(leave_name, {
|
2020-08-26 02:11:54 +02:00
|
|
|
description = S("Jungle Tree Leaves (@1)", jungleleavesnames[color]),
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2014-12-19 03:35:00 +01:00
|
|
|
tiles = {"moretrees_jungletree_leaves_"..jungleleaves[color]..".png"},
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2017-03-31 03:51:58 +02:00
|
|
|
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 3 },
|
2024-05-26 17:08:14 +02:00
|
|
|
drop = minetest.get_modpath("default") and {
|
2013-01-20 00:36:13 +01:00
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2015-08-14 17:50:34 +02:00
|
|
|
{items = {"default:junglesapling"}, rarity = 100 },
|
2013-01-25 05:22:46 +01:00
|
|
|
{items = {"moretrees:jungletree_leaves_"..jungleleaves[color]} }
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
2024-05-26 17:08:14 +02:00
|
|
|
} or nil,
|
|
|
|
sounds = xcompat.sounds.node_sound_leaves_defaults(),
|
2013-01-20 00:36:13 +01:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-03-31 03:51:58 +02:00
|
|
|
-- To get Moretrees to generate its own jungle trees among the default mapgen
|
|
|
|
-- we need our own copy of that node, which moretrees will match against.
|
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
if minetest.get_modpath("default") then
|
|
|
|
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
|
|
|
|
jungle_tree.drop = "default:jungletree"
|
|
|
|
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
|
2017-03-31 03:51:58 +02:00
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
default.register_leafdecay({
|
|
|
|
trunks = { "default:jungletree", "moretrees:jungletree_trunk" },
|
|
|
|
leaves = { xcompat.materials.jungle_leaves, "moretrees:jungletree_leaves_yellow", "moretrees:jungletree_leaves_red" },
|
|
|
|
radius = moretrees.leafdecay_radius,
|
|
|
|
})
|
|
|
|
end
|
2017-03-31 03:51:58 +02:00
|
|
|
|
2013-01-25 05:22:46 +01:00
|
|
|
-- Extra needles for firs
|
2013-01-20 00:36:13 +01:00
|
|
|
|
2013-12-15 19:30:17 +01:00
|
|
|
local moretrees_leaves_inventory_image = nil
|
|
|
|
|
2013-11-16 23:38:46 +01:00
|
|
|
if moretrees.plantlike_leaves then
|
|
|
|
moretrees_leaves_inventory_image = minetest.inventorycube("moretrees_fir_leaves_bright.png")
|
|
|
|
end
|
|
|
|
|
2013-01-22 02:50:41 +01:00
|
|
|
minetest.register_node("moretrees:fir_leaves_bright", {
|
2013-11-15 00:05:37 +01:00
|
|
|
drawtype = moretrees_new_leaves_drawtype,
|
2013-11-27 08:48:43 +01:00
|
|
|
waving = moretrees_new_leaves_waving,
|
2013-11-23 05:51:42 +01:00
|
|
|
visual_scale = moretrees_plantlike_leaves_visual_scale,
|
2014-03-12 22:24:42 +01:00
|
|
|
description = S("Douglas Fir Leaves (Bright)"),
|
2014-12-19 03:35:00 +01:00
|
|
|
tiles = { "moretrees_fir_leaves_bright.png" },
|
2013-11-16 23:38:46 +01:00
|
|
|
inventory_image = moretrees_leaves_inventory_image,
|
2013-01-20 00:36:13 +01:00
|
|
|
paramtype = "light",
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2017-03-31 03:51:58 +02:00
|
|
|
groups = {snappy = 3, flammable = 2, leaves = 1, moretrees_leaves = 1, leafdecay = 3 },
|
2013-01-20 00:36:13 +01:00
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2013-01-31 03:51:18 +01:00
|
|
|
{items = {'moretrees:fir_sapling'}, rarity = 100 },
|
2014-07-13 09:18:22 +02:00
|
|
|
{items = {'moretrees:fir_leaves_bright'} }
|
2013-01-20 00:36:13 +01:00
|
|
|
}
|
|
|
|
},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_leaves_defaults()
|
2013-01-20 00:36:13 +01:00
|
|
|
})
|
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
if minetest.get_modpath("default") then
|
|
|
|
default.register_leafdecay({
|
|
|
|
trunks = { "moretrees:fir_trunk" },
|
|
|
|
leaves = { "moretrees:fir_leaves", "moretrees:fir_leaves_bright" },
|
|
|
|
radius = moretrees.leafdecay_radius,
|
|
|
|
})
|
|
|
|
end
|
2017-03-31 03:51:58 +02:00
|
|
|
|
|
|
|
|
2024-05-26 17:08:14 +02:00
|
|
|
if minetest.get_modpath("default") and moretrees.enable_redefine_apple then
|
2019-06-18 20:37:06 +02:00
|
|
|
local appledef = table.copy(minetest.registered_nodes["default:apple"])
|
2015-07-30 15:42:47 +02:00
|
|
|
appledef.groups.attached_node = 1
|
|
|
|
minetest.register_node(":default:apple", appledef)
|
2013-02-11 18:23:05 +01:00
|
|
|
end
|
|
|
|
|
2013-02-12 04:07:40 +01:00
|
|
|
table.insert(moretrees.avoidnodes, "default:jungletree")
|
2015-08-14 17:50:34 +02:00
|
|
|
table.insert(moretrees.avoidnodes, "default:pine_tree")
|
|
|
|
table.insert(moretrees.avoidnodes, "default:acacia_tree")
|
2013-02-12 04:07:40 +01:00
|
|
|
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
|
2013-04-09 04:54:22 +02:00
|
|
|
table.insert(moretrees.avoidnodes, "default:tree")
|
2013-01-22 02:31:28 +01:00
|
|
|
|
2013-09-15 04:44:32 +02:00
|
|
|
if moretrees.spawn_saplings then
|
2017-08-13 01:02:54 +02:00
|
|
|
table.insert(moretrees.avoidnodes, "snow:sapling_pine")
|
|
|
|
table.insert(moretrees.avoidnodes, "default:junglesapling")
|
|
|
|
table.insert(moretrees.avoidnodes, "default:pine_sapling")
|
2013-09-15 04:44:32 +02:00
|
|
|
end
|
|
|
|
|
2013-04-13 19:58:35 +02:00
|
|
|
-- "empty" (tapped) rubber tree nodes
|
|
|
|
|
|
|
|
minetest.register_node("moretrees:rubber_tree_trunk_empty", {
|
2014-03-12 22:24:42 +01:00
|
|
|
description = S("Rubber Tree Trunk (Empty)"),
|
2013-04-13 19:58:35 +02:00
|
|
|
tiles = {
|
|
|
|
"moretrees_rubber_tree_trunk_top.png",
|
|
|
|
"moretrees_rubber_tree_trunk_top.png",
|
|
|
|
"moretrees_rubber_tree_trunk_empty.png"
|
|
|
|
},
|
|
|
|
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
2024-05-26 17:08:14 +02:00
|
|
|
sounds = xcompat.sounds.node_sound_wood_defaults(),
|
2013-04-13 19:58:35 +02:00
|
|
|
paramtype2 = "facedir",
|
2017-03-15 18:04:48 +01:00
|
|
|
is_ground_content = false,
|
2014-01-30 22:09:23 +01:00
|
|
|
on_place = minetest.rotate_node,
|
2013-04-13 19:58:35 +02:00
|
|
|
})
|
|
|
|
|
2013-04-27 02:12:22 +02:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "moretrees:rubber_tree_trunk_empty_sideways" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
2020-08-26 02:11:18 +02:00
|
|
|
local nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "moretrees:rubber_tree_trunk_empty", param2 = nfdir})
|
2013-04-27 02:12:22 +02:00
|
|
|
end,
|
|
|
|
})
|
2013-04-13 19:58:35 +02:00
|
|
|
|
2015-08-14 17:50:34 +02:00
|
|
|
-- For compatibility with old nodes, recently-changed nodes, and default nodes
|
|
|
|
|
|
|
|
minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk")
|
|
|
|
minetest.register_alias("farming_plus:rubber_tree_full", "moretrees:rubber_tree_trunk")
|
|
|
|
minetest.register_alias("farming:rubber_tree_full", "moretrees:rubber_tree_trunk")
|
|
|
|
|
|
|
|
minetest.register_alias("technic:rubber_leaves", "moretrees:rubber_tree_leaves")
|
|
|
|
minetest.register_alias("farming_plus:rubber_leaves", "moretrees:rubber_tree_leaves")
|
|
|
|
minetest.register_alias("farming:rubber_leaves", "moretrees:rubber_tree_leaves")
|
|
|
|
|
|
|
|
minetest.register_alias("technic:rubber_tree_sapling", "moretrees:rubber_tree_sapling")
|
|
|
|
minetest.register_alias("farming_plus:rubber_sapling", "moretrees:rubber_tree_sapling")
|
|
|
|
minetest.register_alias("farming:rubber_sapling", "moretrees:rubber_tree_sapling")
|
|
|
|
|
|
|
|
minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk")
|
|
|
|
minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways")
|
|
|
|
minetest.register_alias("moretrees:conifer_leaves", "moretrees:fir_leaves")
|
|
|
|
minetest.register_alias("moretrees:conifer_leaves_bright", "moretrees:fir_leaves_bright")
|
|
|
|
minetest.register_alias("moretrees:conifer_sapling", "moretrees:fir_sapling")
|
|
|
|
|
|
|
|
minetest.register_alias("conifers:trunk", "moretrees:fir_trunk")
|
|
|
|
minetest.register_alias("conifers:trunk_reversed", "moretrees:fir_trunk_sideways")
|
|
|
|
minetest.register_alias("conifers:leaves", "moretrees:fir_leaves")
|
|
|
|
minetest.register_alias("conifers:leaves_special", "moretrees:fir_leaves_bright")
|
|
|
|
minetest.register_alias("conifers:sapling", "moretrees:fir_sapling")
|
|
|
|
|
|
|
|
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
|
|
|
|
minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree")
|
|
|
|
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
|
2024-05-26 17:08:14 +02:00
|
|
|
minetest.register_alias("moretrees:jungletree_leaves_green", xcompat.materials.jungle_leaves)
|
2015-08-14 17:50:34 +02:00
|
|
|
|
|
|
|
minetest.register_alias("moretrees:acacia_trunk", "default:acacia_tree")
|
|
|
|
minetest.register_alias("moretrees:acacia_planks", "default:acacia_wood")
|
|
|
|
minetest.register_alias("moretrees:acacia_sapling", "default:acacia_sapling")
|
|
|
|
minetest.register_alias("moretrees:acacia_leaves", "default:acacia_leaves")
|
|
|
|
|
2016-05-18 16:54:45 +02:00
|
|
|
minetest.register_alias("moretrees:pine_trunk", "moretrees:cedar_trunk")
|
|
|
|
minetest.register_alias("moretrees:pine_planks", "moretrees:cedar_planks")
|
|
|
|
minetest.register_alias("moretrees:pine_sapling", "moretrees:cedar_sapling")
|
|
|
|
minetest.register_alias("moretrees:pine_leaves", "moretrees:cedar_leaves")
|
|
|
|
minetest.register_alias("moretrees:pine_cone", "moretrees:cedar_cone")
|
|
|
|
minetest.register_alias("moretrees:pine_nuts", "moretrees:cedar_nuts")
|
2016-08-21 21:56:02 +02:00
|
|
|
minetest.register_alias("moretrees:pine_sapling_ongen", "moretrees:cedar_sapling_ongen")
|
2016-05-18 22:54:19 +02:00
|
|
|
|
|
|
|
minetest.register_alias("moretrees:dates", "moretrees:dates_f4")
|