Merge remote-tracking branch 'upstream/master'

This commit is contained in:
bri cassa 2021-07-24 13:12:23 +02:00
commit 8e2148ffc3
18 changed files with 55 additions and 54 deletions

View File

@ -188,7 +188,7 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
@ -230,7 +230,7 @@ abstract_bushes.grow_youngtree_node2 = function(pos, height)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",

View File

@ -30,7 +30,7 @@ local modpath = minetest.get_modpath('bushes_classic')
dofile(modpath..'/cooking.lua') dofile(modpath..'/cooking.lua')
dofile(modpath..'/nodes.lua') dofile(modpath..'/nodes.lua')
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = 3600, spawn_delay = 3600,
spawn_plants = bushes_classic.spawn_list, spawn_plants = bushes_classic.spawn_list,
avoid_radius = 10, avoid_radius = 10,

View File

@ -1,6 +1,6 @@
--Map Generation Stuff --Map Generation Stuff
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
@ -20,7 +20,7 @@ biome_lib:register_generate_plant(
} }
) )
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:desert_sand", "default:desert_sand",

View File

@ -95,7 +95,7 @@ minetest.register_node("dryplants:juncus_02", {
-- GENERATE SMALL JUNCUS -- GENERATE SMALL JUNCUS
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- near water or swamp -- near water or swamp
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",
@ -116,7 +116,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_juncus abstract_dryplants.grow_juncus
) )
-- at dunes/beach -- at dunes/beach
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
--"default:dirt_with_grass", --"default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",

View File

@ -11,7 +11,7 @@ abstract_dryplants.grow_grass_variation = function(pos)
minetest.swap_node(pos, {name="dryplants:grass_short"}) minetest.swap_node(pos, {name="dryplants:grass_short"})
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
}, },

View File

@ -7,7 +7,7 @@
-- Looked at code from: default -- Looked at code from: default
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
biome_lib:register_generate_plant( biome_lib.register_on_generate(
{ {
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",

View File

@ -330,7 +330,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- SPAWN REEDMACE -- SPAWN REEDMACE
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
--[[biome_lib:spawn_on_surfaces({ --[[biome_lib.register_active_spawner({
spawn_delay = 1200, spawn_delay = 1200,
spawn_plants = {"dryplants:reedmace_sapling"}, spawn_plants = {"dryplants:reedmace_sapling"},
spawn_chance = 400, spawn_chance = 400,
@ -351,7 +351,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
-- GENERATE REEDMACE -- GENERATE REEDMACE
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- near water or swamp -- near water or swamp
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:desert_sand", "default:desert_sand",
@ -372,7 +372,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_reedmace abstract_dryplants.grow_reedmace
) )
-- in water -- in water
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt", "default:dirt",
"default:dirt_with_grass", "default:dirt_with_grass",
@ -395,7 +395,7 @@ biome_lib:register_generate_plant({
abstract_dryplants.grow_reedmace_water abstract_dryplants.grow_reedmace_water
) )
-- for oases & tropical beaches & tropical swamps -- for oases & tropical beaches & tropical swamps
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand", "default:sand",
"sumpf:sumpf" "sumpf:sumpf"

View File

@ -87,7 +87,7 @@ end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.lady_ferns_near_tree == true then if abstract_ferns.config.lady_ferns_near_tree == true then
biome_lib:register_generate_plant({ -- near trees (woodlands) biome_lib.register_on_generate({ -- near trees (woodlands)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -116,7 +116,7 @@ if abstract_ferns.config.lady_ferns_near_tree == true then
end end
if abstract_ferns.config.lady_ferns_near_rock == true then if abstract_ferns.config.lady_ferns_near_rock == true then
biome_lib:register_generate_plant({ -- near stone (mountains) biome_lib.register_on_generate({ -- near stone (mountains)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -143,7 +143,7 @@ if abstract_ferns.config.lady_ferns_near_rock == true then
end end
if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop
biome_lib:register_generate_plant({ -- near ores (potential mining sites) biome_lib.register_on_generate({ -- near ores (potential mining sites)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
@ -183,7 +183,7 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
end end
if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",

View File

@ -298,7 +298,7 @@ minetest.register_abm({
-- in jungles -- in jungles
if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16 "default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
@ -324,7 +324,7 @@ end
-- for oases & tropical beaches -- for oases & tropical beaches
if abstract_ferns.config.enable_giant_treeferns_in_oases == true then if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"

View File

@ -75,7 +75,7 @@ create_nodes()
-- Spawning -- Spawning
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.enable_horsetails_spawning == true then if abstract_ferns.config.enable_horsetails_spawning == true then
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = 1200, spawn_delay = 1200,
spawn_plants = node_names, spawn_plants = node_names,
spawn_chance = 400, spawn_chance = 400,
@ -104,7 +104,7 @@ end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if abstract_ferns.config.enable_horsetails_on_grass == true then if abstract_ferns.config.enable_horsetails_on_grass == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_coniferous_litter", -- minetest >= 0.5 "default:dirt_with_coniferous_litter", -- minetest >= 0.5
@ -137,7 +137,7 @@ if abstract_ferns.config.enable_horsetails_on_grass == true then
end end
if abstract_ferns.config.enable_horsetails_on_stones == true then if abstract_ferns.config.enable_horsetails_on_stones == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:gravel", -- roots go deep "default:gravel", -- roots go deep
"default:mossycobble", "default:mossycobble",

View File

@ -179,7 +179,7 @@ minetest.register_abm({
-- in jungles -- in jungles
if abstract_ferns.config.enable_treeferns_in_jungle == true then if abstract_ferns.config.enable_treeferns_in_jungle == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16 "default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
@ -208,7 +208,7 @@ end
-- for oases & tropical beaches -- for oases & tropical beaches
if abstract_ferns.config.enable_treeferns_in_oases == true then if abstract_ferns.config.enable_treeferns_in_oases == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"

View File

@ -80,16 +80,16 @@ for i in ipairs(lilies_list) do
local above_node = minetest.get_node(pt.above) local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos) local top_node = minetest.get_node(top_pos)
if biome_lib:get_nodedef_field(under_node.name, "buildable_to") then if biome_lib.get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then if under_node.name ~= "default:water_source" then
place_pos = pt.under place_pos = pt.under
elseif top_node.name ~= "default:water_source" elseif top_node.name ~= "default:water_source"
and biome_lib:get_nodedef_field(top_node.name, "buildable_to") then and biome_lib.get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos place_pos = top_pos
else else
return return
end end
elseif biome_lib:get_nodedef_field(above_node.name, "buildable_to") then elseif biome_lib.get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above place_pos = pt.above
end end
@ -180,18 +180,19 @@ for i in ipairs(algae_list) do
local above_node = minetest.get_node(pt.above) local above_node = minetest.get_node(pt.above)
local top_node = minetest.get_node(top_pos) local top_node = minetest.get_node(top_pos)
if biome_lib:get_nodedef_field(under_node.name, "buildable_to") then if biome_lib.get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then if under_node.name ~= "default:water_source" then
place_pos = pt.under place_pos = pt.under
elseif top_node.name ~= "default:water_source" elseif top_node.name ~= "default:water_source"
and biome_lib:get_nodedef_field(top_node.name, "buildable_to") then and biome_lib.get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos place_pos = top_pos
else else
return return
end end
elseif biome_lib:get_nodedef_field(above_node.name, "buildable_to") then elseif biome_lib.get_nodedef_field(above_node.name, "buildable_to") then
place_pos = pt.above place_pos = pt.above
end end
if not place_pos then return end -- something went wrong :P
if not minetest.is_protected(place_pos, placer:get_player_name()) then if not minetest.is_protected(place_pos, placer:get_player_name()) then
@ -301,7 +302,7 @@ flowers_plus.grow_waterlily = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:water_source"}, surface = {"default:water_source"},
max_count = lilies_max_count, max_count = lilies_max_count,
rarity = lilies_rarity, rarity = lilies_rarity,
@ -323,7 +324,7 @@ flowers_plus.grow_seaweed = function(pos)
minetest.swap_node(right_here, {name="along_shore:seaweed_"..random(1,4), param2=random(1,3)}) minetest.swap_node(right_here, {name="along_shore:seaweed_"..random(1,4), param2=random(1,3)})
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:water_source"}, surface = {"default:water_source"},
max_count = seaweed_max_count, max_count = seaweed_max_count,
rarity = seaweed_rarity, rarity = seaweed_rarity,
@ -340,7 +341,7 @@ biome_lib:register_generate_plant({
-- seaweed at beaches -- seaweed at beaches
-- MM: not satisfied with it, but IMHO some beaches should have some algae -- MM: not satisfied with it, but IMHO some beaches should have some algae
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:water_source"}, surface = {"default:water_source"},
max_count = seaweed_max_count, max_count = seaweed_max_count,
rarity = seaweed_rarity, rarity = seaweed_rarity,
@ -356,7 +357,7 @@ biome_lib:register_generate_plant({
}, },
flowers_plus.grow_seaweed flowers_plus.grow_seaweed
) )
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:sand"}, surface = {"default:sand"},
max_count = seaweed_max_count*2, max_count = seaweed_max_count*2,
rarity = seaweed_rarity/2, rarity = seaweed_rarity/2,
@ -373,7 +374,7 @@ biome_lib:register_generate_plant({
flowers_plus.grow_seaweed flowers_plus.grow_seaweed
) )
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
avoid_nodes = { "flowers:sunflower" }, avoid_nodes = { "flowers:sunflower" },
max_count = sunflowers_max_count, max_count = sunflowers_max_count,
@ -388,7 +389,7 @@ biome_lib:register_generate_plant({
-- spawn ABM registrations -- spawn ABM registrations
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY/2, spawn_delay = SPAWN_DELAY/2,
spawn_plants = { spawn_plants = {
"flowers:waterlily", "flowers:waterlily",
@ -410,7 +411,7 @@ biome_lib:spawn_on_surfaces({
random_facedir = {0,3} random_facedir = {0,3}
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY*2, spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"}, spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2, spawn_chance = SPAWN_CHANCE*2,
@ -423,7 +424,7 @@ biome_lib:spawn_on_surfaces({
facedir = 1 facedir = 1
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY*2, spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"}, spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2, spawn_chance = SPAWN_CHANCE*2,
@ -437,7 +438,7 @@ biome_lib:spawn_on_surfaces({
facedir = 1 facedir = 1
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY*2, spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:seaweed"}, spawn_plants = {"flowers:seaweed"},
spawn_chance = SPAWN_CHANCE*2, spawn_chance = SPAWN_CHANCE*2,
@ -451,7 +452,7 @@ biome_lib:spawn_on_surfaces({
facedir = 1 facedir = 1
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY*2, spawn_delay = SPAWN_DELAY*2,
spawn_plants = {"flowers:sunflower"}, spawn_plants = {"flowers:sunflower"},
spawn_chance = SPAWN_CHANCE*2, spawn_chance = SPAWN_CHANCE*2,

View File

@ -62,7 +62,7 @@ abstract_molehills.place_molehill = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Molehills_Max_Count, max_count = Molehills_Max_Count,
rarity = Molehills_Rarity, rarity = Molehills_Rarity,

View File

@ -70,7 +70,7 @@ minetest.register_node('poisonivy:climbing', {
buildable_to = true, buildable_to = true,
}) })
biome_lib:spawn_on_surfaces({ biome_lib.register_active_spawner({
spawn_delay = SPAWN_DELAY, spawn_delay = SPAWN_DELAY,
spawn_plants = {"poisonivy:seedling"}, spawn_plants = {"poisonivy:seedling"},
avoid_radius = 10, avoid_radius = 10,
@ -83,7 +83,7 @@ biome_lib:spawn_on_surfaces({
verticals_list = walls_list verticals_list = walls_list
}) })
biome_lib:grow_plants({ biome_lib.update_plant({
grow_delay = SPAWN_DELAY, grow_delay = SPAWN_DELAY,
grow_chance = GROW_CHANCE, grow_chance = GROW_CHANCE,
grow_plant = "poisonivy:seedling", grow_plant = "poisonivy:seedling",
@ -91,7 +91,7 @@ biome_lib:grow_plants({
grow_nodes = {"default:dirt_with_grass"} grow_nodes = {"default:dirt_with_grass"}
}) })
biome_lib:grow_plants({ biome_lib.update_plant({
grow_delay = GROW_DELAY, grow_delay = GROW_DELAY,
grow_chance = GROW_CHANCE*2, grow_chance = GROW_CHANCE*2,
grow_plant = "poisonivy:climbing", grow_plant = "poisonivy:climbing",

View File

@ -169,7 +169,7 @@ abstract_trunks.place_twig = function(pos)
end end
if Twigs_on_ground == true then if Twigs_on_ground == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Twigs_on_ground_Max_Count, max_count = Twigs_on_ground_Max_Count,
rarity = Twigs_on_ground_Rarity, rarity = Twigs_on_ground_Rarity,
@ -186,7 +186,7 @@ biome_lib:register_generate_plant({
end end
if Twigs_on_water == true then if Twigs_on_water == true then
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:water_source"}, surface = {"default:water_source"},
max_count = Twigs_on_water_Max_Count, max_count = Twigs_on_water_Max_Count,
rarity = Twigs_on_water_Rarity, rarity = Twigs_on_water_Rarity,
@ -348,7 +348,7 @@ abstract_trunks.place_trunk = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Trunks_Max_Count, -- 320, max_count = Trunks_Max_Count, -- 320,
rarity = Trunks_Rarity, -- 99, rarity = Trunks_Rarity, -- 99,
@ -382,7 +382,7 @@ abstract_trunks.grow_moss_on_ground = function(pos)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"}, surface = {"default:dirt_with_grass"},
max_count = Moss_on_ground_Max_Count, max_count = Moss_on_ground_Max_Count,
rarity = Moss_on_ground_Rarity, rarity = Moss_on_ground_Rarity,
@ -471,7 +471,7 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
--end --end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:tree", "default:tree",
"default:jungletree", "default:jungletree",
@ -548,7 +548,7 @@ abstract_trunks.grow_roots = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = {"group:tree"}, surface = {"group:tree"},
max_count = 1000, max_count = 1000,
rarity = 1, rarity = 1,

View File

@ -135,7 +135,7 @@ vines.register_vine = function( name, defs, biome )
end, end,
}) })
biome_lib:spawn_on_surfaces(biome) biome_lib.register_active_spawner(biome)
end end
-- ALIASES -- ALIASES

View File

@ -73,7 +73,7 @@ abstract_woodsoils.place_soil = function(pos)
end end
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"group:tree", "group:tree",
"ferns:fern_03", "ferns:fern_03",
@ -94,7 +94,7 @@ biome_lib:register_generate_plant({
"abstract_woodsoils.place_soil" "abstract_woodsoils.place_soil"
) )
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"moretrees:apple_tree_sapling_ongen", "moretrees:apple_tree_sapling_ongen",
"moretrees:beech_sapling_ongen", "moretrees:beech_sapling_ongen",

View File

@ -134,7 +134,7 @@ abstract_youngtrees.grow_youngtree_node = function(pos, height)
end end
biome_lib:register_generate_plant({ biome_lib.register_on_generate({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",