mirror of
https://github.com/minetest/minetest.git
synced 2024-09-27 15:00:30 +02:00
Interval = 60, chance = 20
This commit is contained in:
parent
757b5963f6
commit
dd2469e071
|
@ -24,8 +24,8 @@ end)
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"default:sapling"},
|
nodenames = {"default:sapling"},
|
||||||
interval = 10,
|
interval = 60,
|
||||||
chance = 50,
|
chance = 20,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
if not minetest.env:get_node_light(pos) then
|
if not minetest.env:get_node_light(pos) then
|
||||||
return
|
return
|
||||||
|
@ -33,14 +33,17 @@ minetest.register_abm({
|
||||||
if minetest.env:get_node_light(pos) < 8 then
|
if minetest.env:get_node_light(pos) < 8 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for dy=1,5 do
|
local height = math.random(4,5)
|
||||||
pos.y = pos.y+dy
|
for y=1,4 do
|
||||||
if not minetest.registered_nodes[minetest.env:get_node(pos).name].buildable_to then
|
if not minetest.env:get_node({x=pos.x,y=pos.y+y,z=pos.z}).buildable_to then
|
||||||
|
if y == 4 then
|
||||||
|
height = 4
|
||||||
|
else
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pos.y = pos.y-dy
|
|
||||||
end
|
end
|
||||||
make_tree(pos, math.random(1,4)==1)
|
end
|
||||||
|
make_tree(pos, math.random(1,4)==1, height)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,12 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function make_tree(pos, is_apple_tree)
|
function make_tree(pos, is_apple_tree, height)
|
||||||
for _=1,math.random(4,5) do
|
if not height then
|
||||||
|
height = math.random(4,5)
|
||||||
|
end
|
||||||
|
|
||||||
|
for _=1,height do
|
||||||
minetest.env:set_node(pos, {name="default:tree"})
|
minetest.env:set_node(pos, {name="default:tree"})
|
||||||
pos.y = pos.y+1
|
pos.y = pos.y+1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user