1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2024-11-05 09:50:27 +01:00

don't use a function to pick random dry grasses

just use `biome_lib`'s random-choice table feature
(it was only there to let the mod replace junglegrass, but that's pointless
when junglegrass doesn't tend to spawn in the same areas)
This commit is contained in:
Vanessa Dannenberg 2021-04-06 03:32:04 -04:00
parent a750bac532
commit 81b2b0898b

View File

@ -7,26 +7,24 @@
-- Looked at code from: default
-----------------------------------------------------------------------------------------------
abstract_dryplants.grow_grass = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local grass_size = math.random(1,5)
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.swap_node(right_here, {name="default:grass_"..grass_size})
end
end
biome_lib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"stoneage:grass_with_silex",
"sumpf:peat",
"sumpf:sumpf"
biome_lib:register_generate_plant(
{
surface = {
"default:dirt_with_grass",
"stoneage:grass_with_silex",
"sumpf:peat",
"sumpf:sumpf"
},
max_count = TALL_GRASS_PER_MAPBLOCK,
rarity = 101 - TALL_GRASS_RARITY,
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
check_air = true,
},
max_count = TALL_GRASS_PER_MAPBLOCK,
rarity = 101 - TALL_GRASS_RARITY,
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
},
abstract_dryplants.grow_grass
{ "default:grass_1",
"default:grass_2",
"default:grass_3",
"default:grass_4",
"default:grass_5"
}
)