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.

171 lines
4.5KB

  1. --[[
  2. Nether mod for minetest
  3. Copyright (C) 2013 PilzAdam
  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. local S = nether.get_translator
  17. -- Portal/wormhole nodes
  18. nether.register_wormhole_node("nether:portal", {
  19. description = S("Nether Portal"),
  20. post_effect_color = {
  21. -- post_effect_color can't be changed dynamically in Minetest like the portal colour is.
  22. -- If you need a different post_effect_color then use register_wormhole_node to create
  23. -- another wormhole node and set it as the wormhole_node_name in your portaldef.
  24. -- Hopefully this colour is close enough to magenta to work with the traditional magenta
  25. -- portals, close enough to red to work for a red portal, and also close enough to red to
  26. -- work with blue & cyan portals - since blue portals are sometimes portrayed as being red
  27. -- from the opposite side / from the inside.
  28. a = 160, r = 128, g = 0, b = 80
  29. }
  30. })
  31. local portal_animation2 = {
  32. name = "nether_portal_alt.png",
  33. animation = {
  34. type = "vertical_frames",
  35. aspect_w = 16,
  36. aspect_h = 16,
  37. length = 0.5,
  38. },
  39. }
  40. nether.register_wormhole_node("nether:portal_alt", {
  41. description = S("Portal"),
  42. tiles = {
  43. "nether_transparent.png",
  44. "nether_transparent.png",
  45. "nether_transparent.png",
  46. "nether_transparent.png",
  47. portal_animation2,
  48. portal_animation2
  49. },
  50. post_effect_color = {
  51. -- hopefully blue enough to work with blue portals, and green enough to
  52. -- work with cyan portals.
  53. a = 120, r = 0, g = 128, b = 188
  54. }
  55. })
  56. -- Nether nodes
  57. minetest.register_node("nether:rack", {
  58. description = S("Netherrack"),
  59. tiles = {"nether_rack.png"},
  60. is_ground_content = true,
  61. groups = {cracky = 3, level = 2},
  62. sounds = default.node_sound_stone_defaults(),
  63. })
  64. minetest.register_node("nether:sand", {
  65. description = S("Nethersand"),
  66. tiles = {"nether_sand.png"},
  67. is_ground_content = true,
  68. groups = {crumbly = 3, level = 2, falling_node = 1},
  69. sounds = default.node_sound_gravel_defaults({
  70. footstep = {name = "default_gravel_footstep", gain = 0.45},
  71. }),
  72. })
  73. minetest.register_node("nether:glowstone", {
  74. description = S("Glowstone"),
  75. tiles = {"nether_glowstone.png"},
  76. is_ground_content = true,
  77. light_source = 14,
  78. paramtype = "light",
  79. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  80. sounds = default.node_sound_glass_defaults(),
  81. })
  82. minetest.register_node("nether:brick", {
  83. description = S("Nether Brick"),
  84. tiles = {"nether_brick.png"},
  85. is_ground_content = false,
  86. groups = {cracky = 2, level = 2},
  87. sounds = default.node_sound_stone_defaults(),
  88. })
  89. local fence_texture =
  90. "default_fence_overlay.png^nether_brick.png^default_fence_overlay.png^[makealpha:255,126,126"
  91. minetest.register_node("nether:fence_nether_brick", {
  92. description = S("Nether Brick Fence"),
  93. drawtype = "fencelike",
  94. tiles = {"nether_brick.png"},
  95. inventory_image = fence_texture,
  96. wield_image = fence_texture,
  97. paramtype = "light",
  98. sunlight_propagates = true,
  99. is_ground_content = false,
  100. selection_box = {
  101. type = "fixed",
  102. fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
  103. },
  104. groups = {cracky = 2, level = 2},
  105. sounds = default.node_sound_stone_defaults(),
  106. })
  107. -- Register stair and slab
  108. stairs.register_stair_and_slab(
  109. "nether_brick",
  110. "nether:brick",
  111. {cracky = 2, level = 2},
  112. {"nether_brick.png"},
  113. S("Nether Stair"),
  114. S("Nether Slab"),
  115. default.node_sound_stone_defaults()
  116. )
  117. -- StairsPlus
  118. if minetest.get_modpath("moreblocks") then
  119. stairsplus:register_all(
  120. "nether", "brick", "nether:brick", {
  121. description = S("Nether Brick"),
  122. groups = {cracky = 2, level = 2},
  123. tiles = {"nether_brick.png"},
  124. sounds = default.node_sound_stone_defaults(),
  125. })
  126. end
  127. -- Crafting
  128. minetest.register_craft({
  129. output = "nether:brick 4",
  130. recipe = {
  131. {"nether:rack", "nether:rack"},
  132. {"nether:rack", "nether:rack"},
  133. }
  134. })
  135. minetest.register_craft({
  136. output = "nether:fence_nether_brick 6",
  137. recipe = {
  138. {"nether:brick", "nether:brick", "nether:brick"},
  139. {"nether:brick", "nether:brick", "nether:brick"},
  140. },
  141. })