Fruit growth

Fruit grows when blocks are loaded
master
D00Med 2018-05-06 11:06:49 +10:00
parent 71c101d4f6
commit 16d9a30bcd
1 changed files with 53 additions and 1 deletions

View File

@ -243,4 +243,56 @@ function fruit.register_ores()
})
end
fruit.register_ores()
fruit.register_ores()
minetest.register_lbm({
name = "fruit:growth",
nodenames = {"default:leaves"},
run_at_every_load = true,
action = function(pos, node)
if math.random(1,50000) == 1 then
local fruit = math.random(1,3)
if fruit == 1 then
minetest.set_node(pos, {name="fruit:leaves_with_peach"})
elseif fruit == 2 then
minetest.set_node(pos, {name="fruit:leaves_with_pear"})
elseif fruit == 3 then
minetest.set_node(pos, {name="fruit:leaves_with_plum"})
end
end
end,
})
minetest.register_lbm({
name = "fruit:growth_jungle",
nodenames = {"default:jungleleaves"},
run_at_every_load = true,
action = function(pos, node)
if math.random(1,50000) == 1 then
minetest.set_node(pos, {name="fruit:leaves_with_mango"})
end
end,
})
minetest.register_lbm({
name = "fruit:growth_bush",
nodenames = {"default:bush_leaves"},
run_at_every_load = true,
action = function(pos, node)
if math.random(1,30000) == 1 then
minetest.set_node(pos, {name="fruit:leaves_with_berry"})
end
end,
})
minetest.register_lbm({
name = "fruit:growth_savanna",
nodenames = {"default:acacia_leaves"},
run_at_every_load = true,
action = function(pos, node)
if math.random(1,10000) == 1 then
minetest.set_node(pos, {name="fruit:leaves_with_orange"})
end
end,
})