mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-11-12 13:20:39 +01:00
Merge branch 'Zeno' of https://github.com/Zeno-/plantlife_modpack into ferns-cleanup
This commit is contained in:
commit
d1369c25cf
|
@ -1,42 +0,0 @@
|
|||
-- In case you don't wanna have errors:
|
||||
|
||||
-- Only change what's behind a "=" (or "--").
|
||||
-- Don't use caps (behind a "=").
|
||||
|
||||
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).
|
||||
-- Spelling is important.
|
||||
-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...)
|
||||
|
||||
-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment.
|
||||
-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then).
|
||||
-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error).
|
||||
|
||||
-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921
|
||||
|
||||
|
||||
-- Which plants should generate/spawn?
|
||||
Lady_fern = true
|
||||
Horsetails = true
|
||||
Tree_Fern = true
|
||||
Giant_Tree_Fern = true
|
||||
|
||||
-- Where should they generate/spawn? (if they generate/spawn)
|
||||
--
|
||||
-- Lady-Fern
|
||||
Ferns_near_Tree = true
|
||||
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
|
||||
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_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)
|
||||
Horsetails_on_Stony = true -- on gravel, mossy cobble and silex (stoneage mod)
|
||||
--
|
||||
-- Tree_Fern
|
||||
Tree_Ferns_in_Jungle = true
|
||||
Tree_Ferns_for_Oases = true -- for oases and tropical beaches
|
||||
--
|
||||
-- Giant_Tree_Fern
|
||||
Giant_Tree_Ferns_in_Jungle = true
|
||||
Giant_Tree_Ferns_for_Oases = true -- for oases and tropical beaches
|
247
ferns/fern.lua
247
ferns/fern.lua
|
@ -101,149 +101,126 @@ minetest.register_node("ferns:fern_01", {
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--[[plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {"ferns:fern"},
|
||||
spawn_chance = 800,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"dryplants:grass_short",
|
||||
"default:jungletree",
|
||||
"stoneage:grass_with_silex"
|
||||
|
||||
assert(abstract_ferns.config.Lady_fern == true)
|
||||
|
||||
if abstract_ferns.config.Ferns_near_Tree == true then
|
||||
plantslib:register_generate_plant({ -- near trees (woodlands)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:desert_sand",
|
||||
"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
|
||||
},
|
||||
seed_diff = 329,
|
||||
})
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {"ferns:fern_mid"},
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"dryplants:grass_short",
|
||||
"default:jungletree",
|
||||
"stoneage:grass_with_silex"
|
||||
},
|
||||
seed_diff = 329,
|
||||
})]]
|
||||
if Ferns_near_Tree == true then
|
||||
plantslib:register_generate_plant({ -- near trees (woodlands)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:desert_sand",
|
||||
"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
|
||||
},
|
||||
abstract_ferns.grow_fern
|
||||
)
|
||||
abstract_ferns.grow_fern
|
||||
)
|
||||
end
|
||||
|
||||
if Ferns_near_Rock == true then
|
||||
plantslib:register_generate_plant({ -- near stone (mountains)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"group:falling_node",
|
||||
--"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
if abstract_ferns.config.Ferns_near_Rock == true then
|
||||
plantslib:register_generate_plant({ -- near stone (mountains)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"group:falling_node",
|
||||
--"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_fern
|
||||
)
|
||||
end
|
||||
|
||||
if Ferns_near_Ores == true then -- this one causes a huge fps drop
|
||||
plantslib:register_generate_plant({ -- near ores (potential mining sites)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
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)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"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
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_fern
|
||||
)
|
||||
end
|
||||
|
||||
if Ferns_in_Groups == true then -- this one is meant as a replacement of Ferns_near_Ores
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
if abstract_ferns.config.Ferns_in_Groups == true then -- this one is meant as a replacement of Ferns_near_Ores
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_fern
|
||||
)
|
||||
end
|
||||
|
|
|
@ -11,114 +11,81 @@
|
|||
-- lot of code, lot to load
|
||||
|
||||
abstract_ferns.grow_giant_tree_fern = function(pos)
|
||||
local size = math.random(12,16) -- min of range must be >= 4
|
||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
|
||||
local leave_a_1 = {x = pos.x + 1, y = pos.y + size - 1, z = pos.z }
|
||||
local leave_a_2 = {x = pos.x + 2, y = pos.y + size , z = pos.z }
|
||||
local leave_a_3 = {x = pos.x + 3, y = pos.y + size - 1, z = pos.z }
|
||||
local leave_a_4 = {x = pos.x + 4, y = pos.y + size - 2, z = pos.z }
|
||||
|
||||
local leave_b_1 = {x = pos.x - 1, y = pos.y + size - 1, z = pos.z }
|
||||
local leave_b_2 = {x = pos.x - 2, y = pos.y + size, z = pos.z }
|
||||
local leave_b_3 = {x = pos.x - 3, y = pos.y + size - 1, z = pos.z }
|
||||
local leave_b_4 = {x = pos.x - 4, y = pos.y + size - 2, z = pos.z }
|
||||
|
||||
local leave_c_1 = {x = pos.x , y = pos.y + size - 1, z = pos.z + 1}
|
||||
local leave_c_2 = {x = pos.x , y = pos.y + size , z = pos.z + 2}
|
||||
local leave_c_3 = {x = pos.x , y = pos.y + size - 1, z = pos.z + 3}
|
||||
local leave_c_4 = {x = pos.x , y = pos.y + size - 2, z = pos.z + 4}
|
||||
|
||||
local leave_d_1 = {x = pos.x , y = pos.y + size - 1, z = pos.z - 1}
|
||||
local leave_d_2 = {x = pos.x , y = pos.y + size , z = pos.z - 2}
|
||||
local leave_d_3 = {x = pos.x , y = pos.y + size - 1, z = pos.z - 3}
|
||||
local leave_d_4 = {x = pos.x , y = pos.y + size - 2, z = pos.z - 4}
|
||||
|
||||
if minetest.get_node(pos_01).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(pos_01).name == "ferns:sapling_giant_tree_fern"
|
||||
or minetest.get_node(pos_01).name == "default:junglegrass" then
|
||||
|
||||
for i = 1, size-3 do
|
||||
minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, {name="ferns:fern_trunk_big"})
|
||||
end
|
||||
minetest.set_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"})
|
||||
minetest.set_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"})
|
||||
if minetest.get_node(pos_01).name ~= "air"
|
||||
and minetest.get_node(pos_01).name ~= "ferns:sapling_giant_tree_fern"
|
||||
and minetest.get_node(pos_01).name ~= "default:junglegrass" then
|
||||
return
|
||||
end
|
||||
|
||||
-- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result
|
||||
|
||||
if minetest.get_node(leave_a_1).name == "air" then
|
||||
minetest.set_node(leave_a_1, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_a_2).name == "air" then
|
||||
minetest.set_node(leave_a_2, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_a_3).name == "air" then
|
||||
minetest.set_node(leave_a_3, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_a_4).name == "air" then
|
||||
minetest.set_node(leave_a_4, {name="ferns:tree_fern_leave_big_end", param2=3})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_b_1).name == "air" then
|
||||
minetest.set_node(leave_b_1, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_b_2).name == "air" then
|
||||
minetest.set_node(leave_b_2, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_b_3).name == "air" then
|
||||
minetest.set_node(leave_b_3, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_b_4).name == "air" then
|
||||
minetest.set_node(leave_b_4, {name="ferns:tree_fern_leave_big_end", param2=1})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_c_1).name == "air" then
|
||||
minetest.set_node(leave_c_1, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_c_2).name == "air" then
|
||||
minetest.set_node(leave_c_2, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_c_3).name == "air" then
|
||||
minetest.set_node(leave_c_3, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_c_4).name == "air" then
|
||||
minetest.set_node(leave_c_4, {name="ferns:tree_fern_leave_big_end", param2=2})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_d_1).name == "air" then
|
||||
minetest.set_node(leave_d_1, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_d_2).name == "air" then
|
||||
minetest.set_node(leave_d_2, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_d_3).name == "air" then
|
||||
minetest.set_node(leave_d_3, {name="ferns:tree_fern_leave_big"})
|
||||
if minetest.get_node(leave_d_4).name == "air" then
|
||||
minetest.set_node(leave_d_4, {name="ferns:tree_fern_leave_big_end", param2=0})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local size = math.random(12,16) -- min of range must be >= 4
|
||||
|
||||
local leafchecks = {
|
||||
{
|
||||
direction = 3,
|
||||
positions = {
|
||||
{x = pos.x + 1, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x + 2, y = pos.y + size , z = pos.z },
|
||||
{x = pos.x + 3, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x + 4, y = pos.y + size - 2, z = pos.z }
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 1,
|
||||
positions = {
|
||||
{x = pos.x - 1, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x - 2, y = pos.y + size, z = pos.z },
|
||||
{x = pos.x - 3, y = pos.y + size - 1, z = pos.z },
|
||||
{x = pos.x - 4, y = pos.y + size - 2, z = pos.z }
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 2,
|
||||
positions = {
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z + 1},
|
||||
{x = pos.x , y = pos.y + size , z = pos.z + 2},
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z + 3},
|
||||
{x = pos.x , y = pos.y + size - 2, z = pos.z + 4}
|
||||
}
|
||||
},
|
||||
{
|
||||
direction = 0,
|
||||
positions = {
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z - 1},
|
||||
{x = pos.x , y = pos.y + size , z = pos.z - 2},
|
||||
{x = pos.x , y = pos.y + size - 1, z = pos.z - 3},
|
||||
{x = pos.x , y = pos.y + size - 2, z = pos.z - 4}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- bug fixes # 2 - doesn't really work, so disabled for now
|
||||
--[[if minetest.get_node(leave_a_4).name == "ferns:tree_fern_leave_big_end"
|
||||
and minetest.get_node(leave_a_3).name == "ferns:fern_trunk_big" then
|
||||
minetest.set_node(leave_a_4, {name="air"})
|
||||
for i = 1, size-3 do
|
||||
minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, {name="ferns:fern_trunk_big"})
|
||||
end
|
||||
minetest.set_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"})
|
||||
minetest.set_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"})
|
||||
|
||||
-- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result
|
||||
|
||||
-- assert(#leafchecks == 4)
|
||||
for i = 1, 4 do
|
||||
local positions = leafchecks[i].positions
|
||||
local rot = leafchecks[i].direction
|
||||
local endpos = 4 -- If the loop below adds all intermediate leaves then the "terminating" leaf will be at positions[4]
|
||||
-- assert(#positions == 4)
|
||||
-- add leaves so long as the destination nodes are air
|
||||
for j = 1, 3 do
|
||||
if minetest.get_node(positions[j]).name == "air" then
|
||||
minetest.set_node(positions[j], {name="ferns:tree_fern_leave_big"})
|
||||
else
|
||||
endpos = j
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_b_4).name == "ferns:tree_fern_leave_big_end"
|
||||
and minetest.get_node(leave_b_3).name == "ferns:fern_trunk_big" then
|
||||
minetest.set_node(leave_b_4, {name="air"})
|
||||
-- add the terminating leaf if required and possible
|
||||
if endpos == 4 and minetest.get_node(positions[endpos]).name == "air" then
|
||||
minetest.set_node(positions[endpos], {name="ferns:tree_fern_leave_big_end", param2=rot})
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_c_4).name == "ferns:tree_fern_leave_big_end"
|
||||
and minetest.get_node(leave_c_3).name == "ferns:fern_trunk_big" then
|
||||
minetest.set_node(leave_c_4, {name="air"})
|
||||
end
|
||||
|
||||
if minetest.get_node(leave_d_4).name == "ferns:tree_fern_leave_big_end"
|
||||
and minetest.get_node(leave_d_3).name == "ferns:fern_trunk_big" then
|
||||
minetest.set_node(leave_d_4, {name="air"})
|
||||
end]]
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -131,8 +98,6 @@ minetest.register_node("ferns:tree_fern_leaves_giant", {
|
|||
visual_scale = math.sqrt(8),
|
||||
wield_scale = {x=0.175, y=0.175, z=0.175},
|
||||
paramtype = "light",
|
||||
--paramtype2 = "facedir",
|
||||
--tiles = {"[combine:"..TSS..T1.."ferns_5.png"..T2.."ferns_6.png"..T3.."ferns_7.png"..T4.."ferns_8.png^[transformFX^[combine:"..TSS..T1.."ferns_5.png"..T2.."ferns_6.png"..T3.."ferns_7.png"..T4.."ferns_8.png"},
|
||||
tiles = {"ferns_fern_tree_giant.png"},
|
||||
inventory_image = "ferns_fern_tree.png",
|
||||
walkable = false,
|
||||
|
@ -309,58 +274,57 @@ minetest.register_abm({
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE GIANT TREE FERN
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.Giant_Tree_Fern == true)
|
||||
|
||||
-- in jungles
|
||||
if Giant_Tree_Ferns_in_Jungle == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:sand",
|
||||
"default:desert_sand"--,
|
||||
--"dryplants:grass_short"
|
||||
if abstract_ferns.config.Giant_Tree_Ferns_in_Jungle == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:sand",
|
||||
"default:desert_sand"--,
|
||||
--"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,
|
||||
},
|
||||
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
|
||||
},
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
end
|
||||
|
||||
-- for oases & tropical beaches
|
||||
if Giant_Tree_Ferns_for_Oases == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
if abstract_ferns.config.Giant_Tree_Ferns_for_Oases == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default: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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
end
|
||||
|
|
|
@ -94,85 +94,88 @@ minetest.register_node("ferns:horsetail_04", { -- the one in inventory
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if Horsetails_Spawning == true then
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {
|
||||
"ferns:horsetail_01",
|
||||
"ferns:horsetail_02",
|
||||
"ferns:horsetail_03",
|
||||
"ferns:horsetail_04"
|
||||
},
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:gravel"
|
||||
},
|
||||
seed_diff = 329,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","default:gravel"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
})
|
||||
if abstract_ferns.config.Horsetails_Spawning == true then
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {
|
||||
"ferns:horsetail_01",
|
||||
"ferns:horsetail_02",
|
||||
"ferns:horsetail_03",
|
||||
"ferns:horsetail_04"
|
||||
},
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:gravel"
|
||||
},
|
||||
seed_diff = 329,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","default:gravel"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
})
|
||||
end
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Generating
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if Horsetails_on_Grass == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"sumpf:sumpf"
|
||||
|
||||
assert(abstract_ferns.config.Horsetails == true)
|
||||
|
||||
if abstract_ferns.config.Horsetails_on_Grass == true then
|
||||
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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_horsetail
|
||||
)
|
||||
end
|
||||
|
||||
if Horsetails_on_Stony == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex"--, -- roots go deep
|
||||
--"sumpf:sumpf"
|
||||
if abstract_ferns.config.Horsetails_on_Stony == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex"--, -- roots go deep
|
||||
--"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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_horsetail
|
||||
)
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Ferns" -- former "Archae Plantae"
|
||||
local version = "0.1.2"
|
||||
local version = "0.2.0"
|
||||
local mname = "ferns" -- former "archaeplantae"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- (by Mossmanikin)
|
||||
|
@ -8,21 +8,21 @@ local mname = "ferns" -- former "archaeplantae"
|
|||
-----------------------------------------------------------------------------------------------
|
||||
abstract_ferns = {}
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/SeTTiNGS.txt")
|
||||
dofile(minetest.get_modpath("ferns").."/settings.lua")
|
||||
|
||||
if Lady_fern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/fern.lua")
|
||||
if abstract_ferns.config.Lady_fern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/fern.lua")
|
||||
end
|
||||
|
||||
if Horsetails == true then
|
||||
if abstract_ferns.config.Horsetails == true then
|
||||
dofile(minetest.get_modpath("ferns").."/horsetail.lua")
|
||||
end
|
||||
|
||||
if Tree_Fern == true then
|
||||
if abstract_ferns.config.Tree_Fern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/treefern.lua")
|
||||
end
|
||||
|
||||
if Giant_Tree_Fern == true then
|
||||
if abstract_ferns.config.Giant_Tree_Fern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
|
||||
end
|
||||
|
||||
|
@ -30,4 +30,4 @@ dofile(minetest.get_modpath("ferns").."/crafting.lua")
|
|||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
43
ferns/settings.lua
Normal file
43
ferns/settings.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
-- In case you don't wanna have errors:
|
||||
|
||||
-- Only change what's behind a "=" (or "--").
|
||||
-- Don't use caps (behind a "=").
|
||||
|
||||
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).
|
||||
-- Spelling is important.
|
||||
-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...)
|
||||
|
||||
-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment.
|
||||
-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then).
|
||||
-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error).
|
||||
|
||||
-- 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?
|
||||
abstract_ferns.config.Lady_fern = true
|
||||
abstract_ferns.config.Horsetails = true
|
||||
abstract_ferns.config.Tree_Fern = true
|
||||
abstract_ferns.config.Giant_Tree_Fern = true
|
||||
|
||||
-- Where should they generate/spawn? (if they generate/spawn)
|
||||
--
|
||||
-- Lady-Fern
|
||||
abstract_ferns.config.Ferns_near_Tree = true
|
||||
abstract_ferns.config.Ferns_near_Rock = true
|
||||
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
|
||||
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
|
||||
abstract_ferns.config.Horsetails_Spawning = false -- horsetails will grow in already explored areas, over time, near water or gravel
|
||||
abstract_ferns.config.Horsetails_on_Grass = true -- on dirt with grass and swamp (sumpf mod)
|
||||
abstract_ferns.config.Horsetails_on_Stony = true -- on gravel, mossy cobble and silex (stoneage mod)
|
||||
--
|
||||
-- Tree_Fern
|
||||
abstract_ferns.config.Tree_Ferns_in_Jungle = true
|
||||
abstract_ferns.config.Tree_Ferns_for_Oases = true -- for oases and tropical beaches
|
||||
--
|
||||
-- Giant_Tree_Fern
|
||||
abstract_ferns.config.Giant_Tree_Ferns_in_Jungle = true
|
||||
abstract_ferns.config.Giant_Tree_Ferns_for_Oases = true -- for oases and tropical beaches
|
|
@ -188,58 +188,60 @@ minetest.register_abm({
|
|||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE TREE FERN
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.Tree_Fern == true)
|
||||
|
||||
-- in jungles
|
||||
if Tree_Ferns_in_Jungle == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:sand",
|
||||
"default:desert_sand"--,
|
||||
--"dryplants:grass_short"
|
||||
if abstract_ferns.config.Tree_Ferns_in_Jungle == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:sand",
|
||||
"default:desert_sand",
|
||||
},
|
||||
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,
|
||||
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
|
||||
)
|
||||
abstract_ferns.grow_tree_fern
|
||||
)
|
||||
end
|
||||
|
||||
-- for oases & tropical beaches
|
||||
if Tree_Ferns_for_Oases == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
if abstract_ferns.config.Tree_Ferns_for_Oases == true then
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default: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,
|
||||
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
|
||||
abstract_ferns.grow_tree_fern
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user