-for i in ipairs(simple_trees) do
+for i in ipairs(moretrees.simple_trees) do
minetest.register_craft({
- output = "moretrees:"..simple_trees[i].."_trunk_sideways 2",
+ output = "moretrees:"..moretrees.simple_trees[i].."_trunk_sideways 2",
recipe = {
- {"moretrees:"..simple_trees[i].."_trunk", "moretrees:"..simple_trees[i].."_trunk"}
+ {"moretrees:"..moretrees.simple_trees[i].."_trunk", "moretrees:"..moretrees.simple_trees[i].."_trunk"}
}
})
minetest.register_craft({
- output = "moretrees:"..simple_trees[i].."_trunk 2",
+ output = "moretrees:"..moretrees.simple_trees[i].."_trunk 2",
recipe = {
- {"moretrees:"..simple_trees[i].."_trunk_sideways"},
- {"moretrees:"..simple_trees[i].."_trunk_sideways"}
+ {"moretrees:"..moretrees.simple_trees[i].."_trunk_sideways"},
+ {"moretrees:"..moretrees.simple_trees[i].."_trunk_sideways"}
}
})
minetest.register_craft({
type = "shapeless",
- output = "moretrees:"..simple_trees[i].."_planks 4",
+ output = "moretrees:"..moretrees.simple_trees[i].."_planks 4",
recipe = {
- "moretrees:"..simple_trees[i].."_trunk"
+ "moretrees:"..moretrees.simple_trees[i].."_trunk"
}
})
minetest.register_craft({
type = "shapeless",
- output = "moretrees:"..simple_trees[i].."_planks 4",
+ output = "moretrees:"..moretrees.simple_trees[i].."_planks 4",
recipe = {
- "moretrees:"..simple_trees[i].."_trunk_sideways"
+ "moretrees:"..moretrees.simple_trees[i].."_trunk_sideways"
}
})
end
minetest.register_craft({
output = "moretrees:birch_trunk_sideways 2",
recipe = {
- {"moretrees:birch_trunk", "moretrees:spruce_trunk"},
+ {"moretrees:birch_trunk", "moretrees:birch_trunk"},
}
})
table.insert(moretrees.avoidnodes, "moretrees:fir_leaves_bright")
trees = {
- {"beech", "Beech Tree", 4 },
- {"apple_tree", "Apple Tree", 10 },
- {"oak", "Oak Tree", 10, "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
- {"sequoia", "Giant Sequoia", 7 },
- {"birch", "Birch Tree", 10 },
- {"palm", "Palm Tree", 15, "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 },
- {"spruce", "Spruce Tree", 10, "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
- {"pine", "Pine Tree", 10, "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
- {"willow", "Willow Tree", 15 },
- {"rubber_tree", "Rubber Tree", 7 },
+ {"beech", "Beech Tree"},
+ {"apple_tree", "Apple Tree"},
+ {"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
+ {"sequoia", "Giant Sequoia"},
+ {"birch", "Birch Tree"},
+ {"palm", "Palm Tree", "coconut", "Coconut", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 1.0 },
+ {"spruce", "Spruce Tree", "spruce_cone", "Spruce Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
+ {"pine", "Pine Tree", "pine_cone", "Pine Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
+ {"willow", "Willow Tree"},
+ {"rubber_tree", "Rubber Tree"},
{"jungletree", "Jungle Tree"},
- {"fir", "Douglas Fir", 15, "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
+ {"fir", "Douglas Fir", "fir_cone", "Fir Cone", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
}
-simple_trees = { "beech", "apple_tree", "oak", "sequoia", "palm", "pine", "willow", "rubber_tree"}
+moretrees.simple_trees = { "beech", "apple_tree", "oak", "sequoia", "palm", "pine", "willow", "rubber_tree"}
+
+moretrees.leaves_list = {}
+moretrees.trunks_list = {}
for i in ipairs(trees) do
local treename = trees[i][1]
local treedesc = trees[i][2]
- local leafdecayradius = trees[i][3] -- future use, not yet implemented.
- local fruit = trees[i][4]
- local fruitdesc = trees[i][5]
- local selbox = trees[i][6]
- local vscale = trees[i][7]
+ local fruit = trees[i][3]
+ local fruitdesc = trees[i][4]
+ local selbox = trees[i][5]
+ local vscale = trees[i][6]
+
minetest.register_node("moretrees:"..treename.."_trunk", {
description = treedesc.." Trunk",
type = "fixed",
fixed = selbox
},
- groups = {fleshy=3,dig_immediate=3,flammable=2},
+ groups = {fleshy=3,dig_immediate=3,flammable=2, attached_node=1},
sounds = default.node_sound_defaults(),
})
end
drawtype = "allfaces_optional",
tiles = { "moretrees_"..treename.."_leaves.png" },
paramtype = "light",
- groups = {tree=1, snappy=3, flammable=2 },
+ groups = {tree=1, snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
drop = {
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_trunk")
table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_leaves")
+ table.insert(moretrees.leaves_list, "moretrees:"..treename.."_leaves")
+ table.insert(moretrees.trunks_list, "moretrees:"..treename.."_trunk")
end
-- Extra leaves for jungle trees:
},
sounds = default.node_sound_leaves_defaults(),
})
+ table.insert(moretrees.leaves_list, "moretrees:jungletree_leaves_"..jungleleaves[color])
end
-- Extra needles for firs
},
sounds = default.node_sound_leaves_defaults()
})
-
+table.insert(moretrees.leaves_list, "moretrees:fir_leaves_bright")
-- Backward compatbility with old mods/nodes: