init.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. if not minetest.global_exists("lbrim") then lbrim = {} end
  2. lbrim.modpath = minetest.get_modpath("lbrim")
  3. minetest.register_node("lbrim:lava_source", {
  4. description = "Nether Lava Source",
  5. drawtype = "liquid",
  6. tiles = {
  7. {
  8. name = "lbrim_source.png",
  9. animation = {
  10. type = "vertical_frames",
  11. aspect_w = 16,
  12. aspect_h = 16,
  13. length = 3.0,
  14. },
  15. },
  16. },
  17. special_tiles = {
  18. -- New-style lava source material (mostly unused)
  19. {
  20. name = "lbrim_source.png",
  21. animation = {
  22. type = "vertical_frames",
  23. aspect_w = 16,
  24. aspect_h = 16,
  25. length = 3.0,
  26. },
  27. backface_culling = false,
  28. },
  29. },
  30. paramtype = "light",
  31. light_source = default.LIGHT_MAX - 2,
  32. walkable = true,
  33. pointable = false,
  34. diggable = false,
  35. buildable_to = false,
  36. -- Liquids cannot be floodable.
  37. --floodable = true,
  38. is_ground_content = false,
  39. drop = "",
  40. drowning = 1,
  41. liquidtype = "source",
  42. liquid_alternative_flowing = "lbrim:lava_flowing",
  43. liquid_alternative_source = "lbrim:lava_source",
  44. liquid_viscosity = 7,
  45. liquid_renewable = true,
  46. damage_per_second = 16*500,
  47. _damage_per_second_type = "lava",
  48. _death_message = default.lava_death_messages(),
  49. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  50. groups = -- comment
  51. {
  52. lava = 3,
  53. liquid = 2,
  54. igniter = 1,
  55. disable_jump = 1,
  56. melt_around = 3
  57. },
  58. on_blast = function(pos, intensity) end,
  59. on_player_walk_over = function(pos, player)
  60. if not gdac.player_is_admin(player) then
  61. local pname = player:get_player_name()
  62. if player:get_hp() > 0 and not heatdamage.is_immune(pname) then
  63. local pa = vector.add(pos, {x=0, y=1, z=0})
  64. if minetest.get_node(pa).name == "air" then
  65. minetest.add_node(pa, {name="fire:basic_flame"})
  66. end
  67. local node = minetest.get_node(pos)
  68. utility.damage_player(player, "lava", 20*500, {
  69. reason = "node_damage",
  70. damage_group = "lava",
  71. source_node = node.name,
  72. node_pos = pos,
  73. })
  74. end
  75. end
  76. end,
  77. on_collapse_to_entity = function(pos, node)
  78. -- Do not allow player to obtain the node itself.
  79. end,
  80. })
  81. minetest.register_node("lbrim:lava_flowing", {
  82. description = "Flowing Nether Lava",
  83. drawtype = "flowingliquid",
  84. tiles = {"lbrim_lava.png"},
  85. special_tiles = {
  86. {
  87. name = "lbrim_flowing.png",
  88. backface_culling = false,
  89. animation = {
  90. type = "vertical_frames",
  91. aspect_w = 16,
  92. aspect_h = 16,
  93. length = 3.3,
  94. },
  95. },
  96. {
  97. name = "lbrim_flowing.png",
  98. backface_culling = true,
  99. animation = {
  100. type = "vertical_frames",
  101. aspect_w = 16,
  102. aspect_h = 16,
  103. length = 3.3,
  104. },
  105. },
  106. },
  107. paramtype = "light",
  108. paramtype2 = "flowingliquid",
  109. light_source = default.LIGHT_MAX - 2,
  110. walkable = false,
  111. pointable = false,
  112. diggable = false,
  113. buildable_to = false,
  114. -- Liquids cannot be floodable.
  115. --floodable = true,
  116. is_ground_content = false,
  117. drop = "",
  118. drowning = 1,
  119. liquidtype = "flowing",
  120. liquid_alternative_flowing = "lbrim:lava_flowing",
  121. liquid_alternative_source = "lbrim:lava_source",
  122. liquid_viscosity = 7,
  123. liquid_renewable = true,
  124. damage_per_second = 16*500,
  125. _damage_per_second_type = "lava",
  126. _death_message = default.lava_death_messages(),
  127. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  128. groups = -- comment
  129. {
  130. lava = 3,
  131. liquid = 2,
  132. igniter = 1,
  133. not_in_creative_inventory = 1,
  134. disable_jump = 1,
  135. melt_around = 3
  136. },
  137. on_blast = function(pos, intensity) end,
  138. on_player_walk_over = function(pos, player)
  139. if not gdac.player_is_admin(player) then
  140. local pname = player:get_player_name()
  141. if player:get_hp() > 0 and not heatdamage.is_immune(pname) then
  142. local pa = vector.add(pos, {x=0, y=1, z=0})
  143. if minetest.get_node(pa).name == "air" then
  144. minetest.add_node(pa, {name="fire:basic_flame"})
  145. end
  146. local node = minetest.get_node(pos)
  147. utility.damage_player(player, "lava", 20*500, {
  148. reason = "node_damage",
  149. damage_group = "lava",
  150. source_node = node.name,
  151. node_pos = pos,
  152. })
  153. end
  154. end
  155. end,
  156. on_collapse_to_entity = function(pos, node)
  157. -- Do not allow player to obtain the node itself.
  158. end,
  159. })