More trees!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.6KB

  1. -- sapling growth
  2. -- these tables only affect hand-placed saplings
  3. -- mapgen-placed always use their biome def settings, which are much more
  4. -- limited, in the interest of speed.
  5. local dirt_surfaces = {
  6. set = true,
  7. ["default:dirt"] = true,
  8. ["default:dirt_with_snow"] = true,
  9. ["default:dry_dirt"] = true,
  10. ["default:dry_dirt_with_dry_grass"] = true,
  11. ["default:dirt_with_grass"] = true,
  12. ["default:dirt_with_dry_grass"] = true,
  13. ["default:dirt_with_coniferous_litter"] = true,
  14. ["default:dirt_with_rainforest_litter"] = true,
  15. ["woodsoils:dirt_with_leaves_1"] = true,
  16. ["woodsoils:dirt_with_leaves_2"] = true,
  17. ["woodsoils:grass_with_leaves_1"] = true,
  18. ["woodsoils:grass_with_leaves_2"] = true,
  19. ["meditteranean_biome:dirt_with_mediterranean_grass"] = true
  20. }
  21. local conifer_surfaces = {
  22. set = true,
  23. ["default:dirt"] = true,
  24. ["default:dirt_with_grass"] = true,
  25. ["default:dirt_with_dry_grass"] = true,
  26. ["default:dirt_with_coniferous_litter"] = true,
  27. ["default:dirt_with_rainforest_litter"] = true,
  28. ["woodsoils:dirt_with_leaves_1"] = true,
  29. ["woodsoils:dirt_with_leaves_2"] = true,
  30. ["woodsoils:grass_with_leaves_1"] = true,
  31. ["woodsoils:grass_with_leaves_2"] = true,
  32. ["default:dirt_with_snow"] = true,
  33. ["meditteranean_biome:dirt_with_mediterranean_grass"] = true
  34. }
  35. local sand_surfaces = {
  36. set = true,
  37. ["default:sand"] = true,
  38. ["default:desert_sand"] = true,
  39. ["cottages:loam"] = true,
  40. ["darkage:mud"] = true,
  41. -- note, no silver sand here.
  42. -- too cold for a palm, too... well... sandy for anything else.
  43. }
  44. for i in ipairs(moretrees.treelist) do
  45. local treename = moretrees.treelist[i][1]
  46. local tree_model = treename.."_model"
  47. local tree_biome = treename.."_biome"
  48. local surfaces
  49. local grow_function = moretrees[tree_model]
  50. if treename == "spruce"
  51. or treename == "fir"
  52. or treename == "cedar"
  53. or treename == "pine" then
  54. surfaces = conifer_surfaces
  55. elseif string.find(treename, "palm") then
  56. surfaces = sand_surfaces
  57. else
  58. surfaces = dirt_surfaces
  59. end
  60. if treename == "spruce"
  61. or treename == "fir"
  62. or treename == "birch"
  63. or treename == "jungletree" then
  64. grow_function = "moretrees.grow_"..treename
  65. end
  66. biome_lib:dbg(dump(moretrees[tree_biome].surface))
  67. biome_lib:grow_plants({
  68. grow_delay = moretrees.sapling_interval,
  69. grow_chance = moretrees.sapling_chance,
  70. grow_plant = "moretrees:"..treename.."_sapling",
  71. grow_nodes = surfaces,
  72. grow_function = grow_function,
  73. })
  74. biome_lib:grow_plants({
  75. grow_delay = 2,
  76. grow_chance = 1,
  77. grow_plant = "moretrees:"..treename.."_sapling_ongen",
  78. grow_nodes = surfaces,
  79. grow_function = grow_function,
  80. })
  81. end