This commit is contained in:
Niklp09 2023-07-16 12:58:19 +02:00
parent ef782ea5e1
commit 09a957dff3
5 changed files with 8 additions and 13 deletions

View File

@ -54,21 +54,18 @@ minetest.register_abm({
chance = 100,
label = "[bushes_classic] spawn bushes",
min_y = -16,
max_y = 48,
max_y = 48,
action = function(pos, node)
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
local n_top = minetest.get_node_or_nil(p_top)
if not n_top then return end
if n_top.name ~= "air" then return end
if not n_top or n_top.name ~= "air" then return end
local perlin_fertile_area = minetest.get_perlin(545342534, 3, 0.6, 100)
local fertility, temperature, humidity = get_biome_data(pos, perlin_fertile_area)
local pos_biome_ok = fertility > -0.1 and temperature <= 0.15 and temperature >= -0.15 and humidity <= 0 and humidity >= -1
if not pos_biome_ok then
return -- Outside of biome
end
if not pos_biome_ok then return end
if minetest.find_node_near(p_top, 10 + math.random(-1.5,2), {"group:bush"}) then
return -- Nodes to avoid are nearby

View File

@ -94,8 +94,7 @@ if abstract_ferns.config.enable_horsetails_spawning == true then
action = function(pos, node)
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
local n_top = minetest.get_node_or_nil(p_top)
if not n_top then return end
if n_top.name ~= "air" then return end
if not n_top or n_top.name ~= "air" then return end
local NEAR_DST = 2
if #minetest.find_nodes_in_area(

View File

@ -7,7 +7,7 @@ local seaweed_max_count = tonumber(minetest.settings:get("pl_seaweed_max_count")
local seaweed_rarity = tonumber(minetest.settings:get("pl_seaweed_rarity")) or 33
local function get_ndef(name)
return minetest.registered_noes[name] or {}
return minetest.registered_nodes[name] or {}
end
local algae_list = { {nil}, {2}, {3}, {4} }

View File

@ -7,7 +7,7 @@ local lilies_max_count = tonumber(minetest.settings:get("pl_waterlilies_max_coun
local lilies_rarity = tonumber(minetest.settings:get("pl_waterlilies_rarity")) or 33
local function get_ndef(name)
return minetest.registered_noes[name] or {}
return minetest.registered_nodes[name] or {}
end
local lilies_list = {

View File

@ -81,12 +81,11 @@ minetest.register_abm({
chance = 20,
label = "[poisoninvy] spawn plants",
min_y = -16,
max_y = 48,
max_y = 48,
action = function(pos, node)
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
local n_top = minetest.get_node_or_nil(p_top)
if not n_top then return end
if n_top.name ~= "air" then return end
if not n_top or n_top.name ~= "air" then return end
local n_light = minetest.get_node_light(p_top)
if n_light < 7 then