Changed spawn rate of rubber tree

This commit is contained in:
N-Nachtigal 2025-07-27 14:55:06 +02:00
parent 1ca13cb635
commit 7302e3514f

View file

@ -91,13 +91,28 @@ minetest.register_abm({
nodenames = {"moretrees:rubber_tree_sapling"}, nodenames = {"moretrees:rubber_tree_sapling"},
label = "Worldgen: grow rubber tree sapling", label = "Worldgen: grow rubber tree sapling",
interval = 60, interval = 60,
chance = 20, chance = 1, --20
action = function(pos, node) action = function(pos, node)
minetest.remove_node(pos) minetest.remove_node(pos)
minetest.spawn_tree(pos, technic.rubber_tree_model) minetest.spawn_tree(pos, technic.rubber_tree_model)
end end
}) })
--[[minetest.register_decoration({
name = "moretrees:rubber_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_rainforest_litter"},
sidelen = 80,
fill_ratio = 0.001,
biomes = {"rainforest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
]]--
if technic.config:get_bool("enable_rubber_tree_generation") then if technic.config:get_bool("enable_rubber_tree_generation") then
minetest.register_on_generated(function(minp, maxp, blockseed) minetest.register_on_generated(function(minp, maxp, blockseed)
if math.random(1, 100) > 5 then if math.random(1, 100) > 5 then
@ -108,7 +123,7 @@ if technic.config:get_bool("enable_rubber_tree_generation") then
y = (maxp.y - minp.y) / 2 + minp.y, y = (maxp.y - minp.y) / 2 + minp.y,
z = (maxp.z - minp.z) / 2 + minp.z} z = (maxp.z - minp.z) / 2 + minp.z}
local pos = minetest.find_node_near(tmp, maxp.x - minp.x, local pos = minetest.find_node_near(tmp, maxp.x - minp.x,
{has_mcl and "mcl_core:dirt_with_grass" or "default:dirt_with_grass"}) {"default:dirt_with_rainforest_litter" or "livingjungle:jungleground"})
if pos ~= nil then if pos ~= nil then
minetest.spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, technic.rubber_tree_model) minetest.spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, technic.rubber_tree_model)
end end