init.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. local modname = minetest.get_current_modname()
  2. local modpath = minetest.get_modpath(modname)
  3. local S = minetest.get_translator(modname)
  4. dofile(modpath .. "/seeds.lua")
  5. dofile(modpath .. "/l_system_gen.lua")
  6. minetest.register_node(modname .. ":wood",
  7. {
  8. description = S("Wood"),
  9. drawtype = "normal",
  10. paramtype2 = "facedir",
  11. is_ground_content = false,
  12. tiles =
  13. {
  14. modname .. "_wood_slice.png",
  15. modname .. "_wood_slice.png",
  16. modname .. "_wood_sides.png",
  17. },
  18. sounds =
  19. {
  20. dig = "wood_low_dig",
  21. dug = "wood_low_dug",
  22. place = "wood_low_place",
  23. footstep = "wood_low_footstep",
  24. },
  25. groups = {choppy = 2},
  26. })
  27. minetest.register_node(modname .. ":leaves",
  28. {
  29. description = S("Leaves"),
  30. drawtype = "normal",
  31. tiles = {modname .. "_leaves.png"},
  32. groups = {oddly_breakable_by_hand = 3},
  33. is_ground_content = false,
  34. sounds =
  35. {
  36. footstep = "plant_footstep",
  37. dig = "plant_dig",
  38. dug = "plant_dug",
  39. place = "plant_place",
  40. }
  41. })
  42. if minetest.get_modpath("eg_mapgen")
  43. then
  44. --DECORATIONS
  45. --small tree
  46. minetest.register_decoration(
  47. {
  48. deco_type = "schematic",
  49. place_on = "eg_mapgen:grass",
  50. sidelen = 2,
  51. noise_params =
  52. {
  53. offset = -0.1,
  54. scale = 0.15,
  55. spread = {x = 200, y = 200, z = 200},
  56. seed = 5802903,
  57. octaves = 3,
  58. persist = 0.7,
  59. lacunarity = 8,
  60. },
  61. y_min = 1,
  62. schematic = modpath .. "/schematics/little_tree.mts",
  63. flags = "place_center_x, place_center_z",
  64. place_offset_y = 1,
  65. })
  66. --palm tree
  67. minetest.register_decoration(
  68. {
  69. deco_type = "schematic",
  70. place_on = "eg_mapgen:sand",
  71. sidelen = 8,
  72. noise_params =
  73. {
  74. offset = -0.1,
  75. scale = 0.15,
  76. spread = {x = 300, y = 300, z = 300},
  77. seed = 5782465,
  78. octaves = 3,
  79. persist = 0.7,
  80. lacunarity = 8,
  81. },
  82. y_min = 1,
  83. schematic = modpath .. "/schematics/palm_tree.mts",
  84. flags = "place_center_x, place_center_z",
  85. place_offset_y = 1,
  86. })
  87. --spruce tree
  88. minetest.register_decoration(
  89. {
  90. deco_type = "schematic",
  91. place_on = "eg_mapgen:grass",
  92. sidelen = 8,
  93. noise_params =
  94. {
  95. offset = -0.2,
  96. scale = 0.45,
  97. spread = {x = 500, y = 500, z = 500},
  98. seed = 2178584,
  99. octaves = 3,
  100. persist = 0.7,
  101. lacunarity = 16,
  102. },
  103. y_min = 70,
  104. schematic = modpath .. "/schematics/spruce.mts",
  105. flags = "place_center_x, place_center_z",
  106. place_offset_y = 1,
  107. })
  108. --tree tree
  109. minetest.register_decoration(
  110. {
  111. deco_type = "schematic",
  112. place_on = "eg_mapgen:grass",
  113. sidelen = 8,
  114. noise_params =
  115. {
  116. offset = -0.3,
  117. scale = 0.4,
  118. spread = {x = 500, y = 500, z = 500},
  119. seed = 5892841,
  120. octaves = 3,
  121. persist = 0.7,
  122. lacunarity = 8,
  123. },
  124. y_min = 1,
  125. schematic = modpath .. "/schematics/tree1.mts",
  126. flags = "place_center_x, place_center_z",
  127. place_offset_y = 1,
  128. })
  129. --thicker tree tree
  130. minetest.register_decoration(
  131. {
  132. deco_type = "schematic",
  133. place_on = "eg_mapgen:grass",
  134. sidelen = 16 ,
  135. noise_params =
  136. {
  137. offset = -0.3,
  138. scale = 0.4,
  139. spread = {x = 500, y = 500, z = 500},
  140. seed = 895682,
  141. octaves = 3,
  142. persist = 0.7,
  143. lacunarity = 8,
  144. },
  145. y_min = 1,
  146. schematic = modpath .. "/schematics/tree2.mts",
  147. flags = "place_center_x, place_center_z",
  148. place_offset_y = 1,
  149. })
  150. end