--saplings
--
--
-local sapling_min = 120
-local sapling_max = 720
+--local sapling_min = 120
+--local sapling_max = 720
--make sapling grow
local function sapling_grow(pos)
if minetest.get_node_light(pos, nil) < 10 then
end
if good_to_grow == true then
minetest.set_node(pos,{name="main:tree"})
- minetest.place_schematic(pos, treeSchematic,"0",nil,false,"place_center_x, place_center_z")
+ local schemmy = math.random(1,2)
+ if schemmy == 1 then
+ minetest.place_schematic(pos, tree_big,"0",nil,false,"place_center_x, place_center_z")
+ elseif schemmy == 2 then
+ minetest.place_schematic(pos, tree_small,"0",nil,false,"place_center_x, place_center_z")
+ end
--override leaves
- for i = 1,4 do
+ local max = 3
+ if schemmy == 2 then
+ max = 1
+ end
+ for i = 1,max do
minetest.set_node(vector.new(pos.x,pos.y+i,pos.z),{name="main:tree"})
end
end
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
- on_place = on_rightclick or function(itemstack, placer, pointed_thing)
+ on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing.type == "node" then
return
end
label = "Tree Grow",
nodenames = {"group:sapling"},
neighbors = {"group:soil"},
- interval = 3,
- chance = 2000,
+ interval = 6,
+ chance = 250,
catch_up = true,
action = function(pos)
sapling_grow(pos)