Nether mod for Minetest
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.

139 lines
4.6KB

  1. --[[
  2. Register decorations for Nether mapgen
  3. Copyright (C) 2020 Treer
  4. Permission to use, copy, modify, and/or distribute this software for
  5. any purpose with or without fee is hereby granted, provided that the
  6. above copyright notice and this permission notice appear in all copies.
  7. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  8. WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  9. WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
  10. BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
  11. OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  12. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  13. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  14. SOFTWARE.
  15. ]]--
  16. -- Lava is unreliable in the old Nether mapgen because it removes lava
  17. -- from the overdraw areas, so any decorations involving lava will often
  18. -- have the lava missing depending on whether nearby chunks were already
  19. -- emerged or not before the decoration was placed.
  20. local allow_lava_decorations = nether.useBiomes
  21. local _ = {name = "air", prob = 0}
  22. local A = {name = "air", prob = 255, force_place = true}
  23. local G = {name = "nether:glowstone", prob = 255, force_place = true}
  24. local N = {name = "nether:rack", prob = 255}
  25. local S = {name = "nether:sand", prob = 255, force_place = true}
  26. local L = {name = "default:lava_source", prob = 255, force_place = true}
  27. -- =================
  28. -- Stalactites
  29. -- =================
  30. local schematic_GlowstoneStalactite = {
  31. size = {x = 5, y = 10, z = 5},
  32. data = {
  33. _, _, _, _, _,
  34. _, _, _, _, _,
  35. _, _, _, _, _,
  36. _, _, _, _, _,
  37. _, _, _, _, _,
  38. _, _, _, _, _,
  39. _, _, _, _, _,
  40. _, _, _, _, _,
  41. _, N, G, N, _,
  42. _, N, N, N, _,
  43. _, _, _, _, _,
  44. _, _, _, _, _,
  45. _, _, _, _, _,
  46. _, _, _, _, _,
  47. _, _, _, _, _,
  48. _, _, G, _, _,
  49. _, _, G, _, _,
  50. _, G, G, G, _,
  51. N, G, G, G, N,
  52. N, N, G, N, N,
  53. _, _, N, _, _, -- ypos 0, prob 25% (64/256)
  54. _, _, G, _, _, -- ypos 1, prob 37% (96/256)
  55. _, _, G, _, _, -- ypos 2, prob 100%
  56. _, _, G, _, _, -- ypos 3, prob 100%
  57. _, _, G, G, _, -- ypos 4, prob 50% (128/256) to make half of stalactites asymmetric
  58. _, G, G, G, _, -- ypos 5, prob 75% (192/256)
  59. _, G, G, G, _, -- ypos 6, prob 75% (192/256)
  60. _, G, G, G, _, -- ypos 7, prob 100%
  61. G, G, G, G, G, -- ypos 8, prob 100%
  62. N, G, G, G, N, -- ypos 9, prob 75% (192/256)
  63. _, _, _, _, _,
  64. _, _, _, _, _,
  65. _, _, _, _, _,
  66. _, _, _, _, _,
  67. _, _, G, _, _,
  68. _, _, G, _, _,
  69. _, _, G, _, _,
  70. _, G, G, G, _,
  71. N, G, G, G, N,
  72. N, N, G, N, N,
  73. _, _, _, _, _,
  74. _, _, _, _, _,
  75. _, _, _, _, _,
  76. _, _, _, _, _,
  77. _, _, _, _, _,
  78. _, _, _, _, _,
  79. _, _, _, _, _,
  80. _, _, _, _, _,
  81. _, N, G, N, _,
  82. _, N, N, N, _
  83. },
  84. -- Y-slice probabilities do not function correctly for ceiling schematic
  85. -- decorations because they are inverted, so ypos numbers have been inverted
  86. -- to match, and a larger offset in place_offset_y should be used (e.g. -3).
  87. yslice_prob = {
  88. {ypos = 9, prob = 192},
  89. {ypos = 6, prob = 192},
  90. {ypos = 5, prob = 192},
  91. {ypos = 4, prob = 128},
  92. {ypos = 1, prob = 96},
  93. {ypos = 0, prob = 64}
  94. }
  95. }
  96. minetest.register_decoration({
  97. name = "Glowstone stalactite",
  98. deco_type = "schematic",
  99. place_on = "nether:rack",
  100. sidelen = 80,
  101. fill_ratio = 0.0003,
  102. biomes = {"nether_caverns"},
  103. y_max = nether.DEPTH_CEILING, -- keep compatibility with mapgen_nobiomes.lua
  104. y_min = nether.DEPTH_FLOOR,
  105. schematic = schematic_GlowstoneStalactite,
  106. flags = "place_center_x,place_center_z,force_placement,all_ceilings",
  107. place_offset_y=-3
  108. })
  109. minetest.register_decoration({
  110. name = "Netherrack stalactite",
  111. deco_type = "schematic",
  112. place_on = "nether:rack",
  113. sidelen = 80,
  114. fill_ratio = 0.0008,
  115. biomes = {"nether_caverns"},
  116. y_max = nether.DEPTH_CEILING, -- keep compatibility with mapgen_nobiomes.lua
  117. y_min = nether.DEPTH_FLOOR,
  118. schematic = schematic_GlowstoneStalactite,
  119. replacements = {["nether:glowstone"] = "nether:rack"},
  120. flags = "place_center_x,place_center_z,all_ceilings",
  121. place_offset_y=-3
  122. })