forked from mtcontrib/plantlife_modpack
chuck all worthless settings stuff, remove disabled code
This commit is contained in:
@ -8,8 +8,6 @@
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_horsetails == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
@ -71,101 +69,57 @@ end
|
||||
|
||||
create_nodes()
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if abstract_ferns.config.enable_horsetails_spawning == true then
|
||||
minetest.register_abm({
|
||||
nodenames = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:gravel"
|
||||
},
|
||||
interval = 1200,
|
||||
chance = 400,
|
||||
label = "[ferns] spawn horsetails",
|
||||
min_y = 1,
|
||||
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 or n_top.name ~= "air" then return end
|
||||
|
||||
local NEAR_DST = 2
|
||||
if #minetest.find_nodes_in_area(
|
||||
{x=pos.x-NEAR_DST, y=pos.y-1, z=pos.z-NEAR_DST},
|
||||
{x=pos.x+NEAR_DST, y=pos.y+1, z=pos.z+NEAR_DST},
|
||||
{"default:water_source","default:river_water_source","default:gravel"}
|
||||
) < 1 then return
|
||||
end
|
||||
|
||||
local plant_to_spawn = node_names[math.random(1, #node_names)]
|
||||
|
||||
minetest.swap_node(p_top, {name = plant_to_spawn, param2 = 0})
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Generating
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_grass == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
|
||||
"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
|
||||
--random_facedir = { 0, 179 },
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
node_names
|
||||
)
|
||||
end
|
||||
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
|
||||
--random_facedir = { 0, 179 },
|
||||
},
|
||||
node_names
|
||||
)
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_stones == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex", -- roots go deep
|
||||
},
|
||||
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
|
||||
--random_facedir = { 0, 179 },
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex", -- roots go deep
|
||||
},
|
||||
node_names
|
||||
)
|
||||
end
|
||||
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
|
||||
--random_facedir = { 0, 179 },
|
||||
},
|
||||
node_names
|
||||
)
|
||||
|
Reference in New Issue
Block a user