From 81b2b0898b39a636c1f7a7ec77aa5fd60e9e1f6a Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Tue, 6 Apr 2021 03:32:04 -0400 Subject: [PATCH] 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) --- dryplants/moregrass.lua | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/dryplants/moregrass.lua b/dryplants/moregrass.lua index b8d5f82..46768e7 100644 --- a/dryplants/moregrass.lua +++ b/dryplants/moregrass.lua @@ -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" + } )