1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2024-11-13 22:00:39 +01:00

Stop polluting global namespace

This commit is contained in:
Craig Robbins 2014-08-20 18:35:08 +10:00
parent 64471c9bfc
commit b069341d33
6 changed files with 310 additions and 297 deletions

View File

@ -127,123 +127,126 @@ plantslib:spawn_on_surfaces({
}, },
seed_diff = 329, seed_diff = 329,
})]] })]]
if Ferns_near_Tree == true then
plantslib:register_generate_plant({ -- near trees (woodlands) assert(abstract_ferns.config.Lady_fern == true)
surface = {
"default:dirt_with_grass", if abstract_ferns.config.Ferns_near_Tree == true then
"default:mossycobble", plantslib:register_generate_plant({ -- near trees (woodlands)
"default:desert_sand", surface = {
"default:sand", "default:dirt_with_grass",
"default:jungletree", "default:mossycobble",
"stoneage:grass_with_silex", "default:desert_sand",
"sumpf:sumpf" "default:sand",
"default:jungletree",
"stoneage:grass_with_silex",
"sumpf:sumpf"
},
max_count = 30,
rarity = 62,--63,
min_elevation = 1, -- above sea level
near_nodes = {"group:tree"},
near_nodes_size = 3,--4,
near_nodes_vertical = 2,--3,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
}, },
max_count = 30, abstract_ferns.grow_fern
rarity = 62,--63, )
min_elevation = 1, -- above sea level
near_nodes = {"group:tree"},
near_nodes_size = 3,--4,
near_nodes_vertical = 2,--3,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
},
abstract_ferns.grow_fern
)
end end
if Ferns_near_Rock == true then if abstract_ferns.config.Ferns_near_Rock == true then
plantslib:register_generate_plant({ -- near stone (mountains) plantslib:register_generate_plant({ -- near stone (mountains)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
"group:falling_node", "group:falling_node",
--"default:jungletree", --"default:jungletree",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:sumpf" "sumpf:sumpf"
},
max_count = 35,
rarity = 40,
min_elevation = 1, -- above sea level
near_nodes = {"group:stone"},
near_nodes_size = 1,
near_nodes_count = 16,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
}, },
max_count = 35, abstract_ferns.grow_fern
rarity = 40, )
min_elevation = 1, -- above sea level
near_nodes = {"group:stone"},
near_nodes_size = 1,
near_nodes_count = 16,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
},
abstract_ferns.grow_fern
)
end end
if Ferns_near_Ores == true then -- this one causes a huge fps drop if abstract_ferns.config.Ferns_near_Ores == true then -- this one causes a huge fps drop
plantslib:register_generate_plant({ -- near ores (potential mining sites) plantslib:register_generate_plant({ -- near ores (potential mining sites)
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
"default:stone_with_coal", "default:stone_with_coal",
"default:stone_with_iron", "default:stone_with_iron",
"moreores:mineral_tin", "moreores:mineral_tin",
"moreores:mineral_silver", "moreores:mineral_silver",
"sumpf:sumpf" "sumpf:sumpf"
},
max_count = 1200,--1600, -- maybe too much? :D
rarity = 25,--15,
min_elevation = 1, -- above sea level
near_nodes = {
"default:stone_with_iron",
--"default:stone_with_copper",
--"default:stone_with_mese",
--"default:stone_with_gold",
--"default:stone_with_diamond",
"moreores:mineral_tin",
"moreores:mineral_silver"
--"moreores:mineral_mithril"
},
near_nodes_size = 2,
near_nodes_vertical = 4,--5,--6,
near_nodes_count = 2,--3,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
}, },
max_count = 1200,--1600, -- maybe too much? :D abstract_ferns.grow_fern
rarity = 25,--15, )
min_elevation = 1, -- above sea level
near_nodes = {
"default:stone_with_iron",
--"default:stone_with_copper",
--"default:stone_with_mese",
--"default:stone_with_gold",
--"default:stone_with_diamond",
"moreores:mineral_tin",
"moreores:mineral_silver"
--"moreores:mineral_mithril"
},
near_nodes_size = 2,
near_nodes_vertical = 4,--5,--6,
near_nodes_count = 2,--3,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
},
abstract_ferns.grow_fern
)
end end
if Ferns_in_Groups == true then -- this one is meant as a replacement of Ferns_near_Ores if abstract_ferns.config.Ferns_in_Groups == true then -- this one is meant as a replacement of Ferns_near_Ores
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:mossycobble", "default:mossycobble",
"default:stone_with_coal", "default:stone_with_coal",
"default:stone_with_iron", "default:stone_with_iron",
"moreores:mineral_tin", "moreores:mineral_tin",
"moreores:mineral_silver", "moreores:mineral_silver",
"sumpf:sumpf" "sumpf:sumpf"
},
max_count = 70,
rarity = 25,--15,
min_elevation = 1, -- above sea level
near_nodes = {
"default:stone"
},
near_nodes_size = 2,
near_nodes_vertical = 2,--6,
near_nodes_count = 3,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
}, },
max_count = 70, abstract_ferns.grow_fern
rarity = 25,--15, )
min_elevation = 1, -- above sea level
near_nodes = {
"default:stone"
},
near_nodes_size = 2,
near_nodes_vertical = 2,--6,
near_nodes_count = 3,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C (too hot?)
temp_min = 0.75, -- -12 °C
},
abstract_ferns.grow_fern
)
end end

View File

@ -276,58 +276,61 @@ minetest.register_abm({
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- GENERATE GIANT TREE FERN -- GENERATE GIANT TREE FERN
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.Giant_Tree_Fern == true)
-- in jungles -- in jungles
if Giant_Tree_Ferns_in_Jungle == true then if abstract_ferns.config.Giant_Tree_Ferns_in_Jungle == true then
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:sand", "default:sand",
"default:desert_sand"--, "default:desert_sand"--,
--"dryplants:grass_short" --"dryplants:grass_short"
},
max_count = 12,--27,
avoid_nodes = {"group:tree"},
avoid_radius = 3,--4,
rarity = 85,
seed_diff = 329,
min_elevation = 1,
near_nodes = {"default:jungletree"},
near_nodes_size = 6,
near_nodes_vertical = 2,--4,
near_nodes_count = 1,
plantlife_limit = -0.9,
--humidity_max = 0.39,--1.0,
--humidity_min = 0.5,
--temp_max = -1,-- -1.2,-- -0.5, -- ~ 55C
--temp_min = -0.35,-- -0.07, -- ~ 25C
}, },
max_count = 12,--27, abstract_ferns.grow_giant_tree_fern
avoid_nodes = {"group:tree"}, )
avoid_radius = 3,--4,
rarity = 85,
seed_diff = 329,
min_elevation = 1,
near_nodes = {"default:jungletree"},
near_nodes_size = 6,
near_nodes_vertical = 2,--4,
near_nodes_count = 1,
plantlife_limit = -0.9,
--humidity_max = 0.39,--1.0,
--humidity_min = 0.5,
--temp_max = -1,-- -1.2,-- -0.5, -- ~ 55C
--temp_min = -0.35,-- -0.07, -- ~ 25C
},
abstract_ferns.grow_giant_tree_fern
)
end end
-- for oases & tropical beaches -- for oases & tropical beaches
if Giant_Tree_Ferns_for_Oases == true then if abstract_ferns.config.Giant_Tree_Ferns_for_Oases == true then
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"
},
max_count = 10,--27,
rarity = 90,
seed_diff = 329,
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 1.0,
temp_max = -1.0,
temp_min = 1.0,
}, },
max_count = 10,--27, abstract_ferns.grow_giant_tree_fern
rarity = 90, )
seed_diff = 329,
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 1.0,
temp_max = -1.0,
temp_min = 1.0,
},
abstract_ferns.grow_giant_tree_fern
)
end end

View File

@ -94,85 +94,88 @@ minetest.register_node("ferns:horsetail_04", { -- the one in inventory
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- Spawning -- Spawning
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if Horsetails_Spawning == true then if abstract_ferns.config.Horsetails_Spawning == true then
plantslib:spawn_on_surfaces({ plantslib:spawn_on_surfaces({
spawn_delay = 1200, spawn_delay = 1200,
spawn_plants = { spawn_plants = {
"ferns:horsetail_01", "ferns:horsetail_01",
"ferns:horsetail_02", "ferns:horsetail_02",
"ferns:horsetail_03", "ferns:horsetail_03",
"ferns:horsetail_04" "ferns:horsetail_04"
}, },
spawn_chance = 400, spawn_chance = 400,
spawn_surfaces = { spawn_surfaces = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:desert_sand", "default:desert_sand",
"default:sand", "default:sand",
"dryplants:grass_short", "dryplants:grass_short",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"default:mossycobble", "default:mossycobble",
"default:gravel" "default:gravel"
}, },
seed_diff = 329, seed_diff = 329,
min_elevation = 1, -- above sea level min_elevation = 1, -- above sea level
near_nodes = {"default:water_source","default:gravel"}, near_nodes = {"default:water_source","default:gravel"},
near_nodes_size = 2, near_nodes_size = 2,
near_nodes_vertical = 1, near_nodes_vertical = 1,
near_nodes_count = 1, near_nodes_count = 1,
}) })
end end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- Generating -- Generating
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if Horsetails_on_Grass == true then
plantslib:register_generate_plant({ assert(abstract_ferns.config.Horsetails == true)
surface = {
"default:dirt_with_grass", if abstract_ferns.config.Horsetails_on_Grass == true then
"sumpf:sumpf" plantslib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"sumpf:sumpf"
},
max_count = 35,
rarity = 40,
min_elevation = 1, -- above sea level
near_nodes = {
"group:water", -- likes water (of course)
"default:gravel", -- near those on gravel
"default:sand", -- some like sand
"default:clay", -- some like clay
"stoneage:grass_with_silex",
"default:mossycobble",
"default:cobble",
"sumpf:sumpf"
},
near_nodes_size = 3,
near_nodes_vertical = 2,--3,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C
temp_min = 0.53, -- 0 °C, dies back in winter
}, },
max_count = 35, abstract_ferns.grow_horsetail
rarity = 40, )
min_elevation = 1, -- above sea level
near_nodes = {
"group:water", -- likes water (of course)
"default:gravel", -- near those on gravel
"default:sand", -- some like sand
"default:clay", -- some like clay
"stoneage:grass_with_silex",
"default:mossycobble",
"default:cobble",
"sumpf:sumpf"
},
near_nodes_size = 3,
near_nodes_vertical = 2,--3,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C
temp_min = 0.53, -- 0 °C, dies back in winter
},
abstract_ferns.grow_horsetail
)
end end
if Horsetails_on_Stony == true then if abstract_ferns.config.Horsetails_on_Stony == true then
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:gravel", -- roots go deep "default:gravel", -- roots go deep
"default:mossycobble", "default:mossycobble",
"stoneage:dirt_with_silex", "stoneage:dirt_with_silex",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"stoneage:sand_with_silex"--, -- roots go deep "stoneage:sand_with_silex"--, -- roots go deep
--"sumpf:sumpf" --"sumpf:sumpf"
},
max_count = 35,
rarity = 20,
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C
temp_min = 0.53, -- 0 °C, dies back in winter
}, },
max_count = 35, abstract_ferns.grow_horsetail
rarity = 20, )
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
humidity_min = 0.4,
temp_max = -0.5, -- 55 °C
temp_min = 0.53, -- 0 °C, dies back in winter
},
abstract_ferns.grow_horsetail
)
end end

View File

@ -10,19 +10,19 @@ abstract_ferns = {}
dofile(minetest.get_modpath("ferns").."/settings.lua") dofile(minetest.get_modpath("ferns").."/settings.lua")
if Lady_fern == true then if abstract_ferns.config.Lady_fern == true then
dofile(minetest.get_modpath("ferns").."/fern.lua") dofile(minetest.get_modpath("ferns").."/fern.lua")
end end
if Horsetails == true then if abstract_ferns.Horsetails == true then
dofile(minetest.get_modpath("ferns").."/horsetail.lua") dofile(minetest.get_modpath("ferns").."/horsetail.lua")
end end
if Tree_Fern == true then if abstract_ferns.config.Tree_Fern == true then
dofile(minetest.get_modpath("ferns").."/treefern.lua") dofile(minetest.get_modpath("ferns").."/treefern.lua")
end end
if Giant_Tree_Fern == true then if abstract_ferns.config.Giant_Tree_Fern == true then
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua") dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
end end

View File

@ -13,30 +13,31 @@
-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921 -- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921
abstract_ferns.config = {}
-- Which plants should generate/spawn? -- Which plants should generate/spawn?
Lady_fern = true abstract_ferns.config.Lady_fern = true
Horsetails = true abstract_ferns.config.Horsetails = true
Tree_Fern = true abstract_ferns.config.Tree_Fern = true
Giant_Tree_Fern = true abstract_ferns.config.Giant_Tree_Fern = true
-- Where should they generate/spawn? (if they generate/spawn) -- Where should they generate/spawn? (if they generate/spawn)
-- --
-- Lady-Fern -- Lady-Fern
Ferns_near_Tree = true abstract_ferns.config.Ferns_near_Tree = true
Ferns_near_Rock = true abstract_ferns.config.Ferns_near_Rock = true
Ferns_near_Ores = true -- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop abstract_ferns.config.Ferns_near_Ores = true -- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop
Ferns_in_Groups = false -- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores abstract_ferns.config.Ferns_in_Groups = false -- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores
-- --
-- Horsetails -- Horsetails
Horsetails_Spawning = false -- horsetails will grow in already explored areas, over time, near water or gravel abstract_ferns.config.Horsetails_Spawning = false -- horsetails will grow in already explored areas, over time, near water or gravel
Horsetails_on_Grass = true -- on dirt with grass and swamp (sumpf mod) abstract_ferns.config.Horsetails_on_Grass = true -- on dirt with grass and swamp (sumpf mod)
Horsetails_on_Stony = true -- on gravel, mossy cobble and silex (stoneage mod) abstract_ferns.config.Horsetails_on_Stony = true -- on gravel, mossy cobble and silex (stoneage mod)
-- --
-- Tree_Fern -- Tree_Fern
Tree_Ferns_in_Jungle = true abstract_ferns.config.Tree_Ferns_in_Jungle = true
Tree_Ferns_for_Oases = true -- for oases and tropical beaches abstract_ferns.config.Tree_Ferns_for_Oases = true -- for oases and tropical beaches
-- --
-- Giant_Tree_Fern -- Giant_Tree_Fern
Giant_Tree_Ferns_in_Jungle = true abstract_ferns.config.Giant_Tree_Ferns_in_Jungle = true
Giant_Tree_Ferns_for_Oases = true -- for oases and tropical beaches abstract_ferns.config.Giant_Tree_Ferns_for_Oases = true -- for oases and tropical beaches

View File

@ -188,58 +188,61 @@ minetest.register_abm({
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- GENERATE TREE FERN -- GENERATE TREE FERN
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.Tree_Fern == true)
-- in jungles -- in jungles
if Tree_Ferns_in_Jungle == true then if abstract_ferns.config.Tree_Ferns_in_Jungle == true then
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:sand", "default:sand",
"default:desert_sand"--, "default:desert_sand"--,
--"dryplants:grass_short" --"dryplants:grass_short"
},
max_count = 35,--27,
avoid_nodes = {"default:tree"},
avoid_radius = 4,
rarity = 50,
seed_diff = 329,
min_elevation = -10,
near_nodes = {"default:jungletree"},
near_nodes_size = 6,
near_nodes_vertical = 2,--4,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5,
temp_min = 0.13,
}, },
max_count = 35,--27, abstract_ferns.grow_tree_fern
avoid_nodes = {"default:tree"}, )
avoid_radius = 4,
rarity = 50,
seed_diff = 329,
min_elevation = -10,
near_nodes = {"default:jungletree"},
near_nodes_size = 6,
near_nodes_vertical = 2,--4,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 0.4,
temp_max = -0.5,
temp_min = 0.13,
},
abstract_ferns.grow_tree_fern
)
end end
-- for oases & tropical beaches -- for oases & tropical beaches
if Tree_Ferns_for_Oases == true then if abstract_ferns.config.Tree_Ferns_for_Oases == true then
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:sand"--, "default:sand"--,
--"default:desert_sand" --"default:desert_sand"
},
max_count = 35,
rarity = 50,
seed_diff = 329,
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 1.0,
temp_max = -1.0,
temp_min = 1.0,
}, },
max_count = 35, abstract_ferns.grow_tree_fern
rarity = 50,
seed_diff = 329,
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
humidity_max = -1.0,
humidity_min = 1.0,
temp_max = -1.0,
temp_min = 1.0,
},
abstract_ferns.grow_tree_fern
) )
end end