moregrass.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. -----------------------------------------------------------------------------------------------
  2. -- Grasses - More Tall Grass 0.0.2
  3. -----------------------------------------------------------------------------------------------
  4. -- by Mossmanikin
  5. -- Contains code from: biome_lib
  6. -- Looked at code from: default
  7. -----------------------------------------------------------------------------------------------
  8. abstract_dryplants.grow_grass = function(pos)
  9. local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
  10. local grass_size = math.random(1,5)
  11. if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
  12. or minetest.get_node(right_here).name == "default:junglegrass" then
  13. minetest.swap_node(right_here, {name="default:grass_"..grass_size})
  14. end
  15. end
  16. biome_lib:register_generate_plant({
  17. surface = {
  18. "default:dirt_with_grass",
  19. "stoneage:grass_with_silex",
  20. "sumpf:peat",
  21. "sumpf:sumpf"
  22. },
  23. max_count = TALL_GRASS_PER_MAPBLOCK,
  24. rarity = 101 - TALL_GRASS_RARITY,
  25. min_elevation = 1, -- above sea level
  26. plantlife_limit = -0.9,
  27. },
  28. abstract_dryplants.grow_grass
  29. )