init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. lbrim = lbrim or {}
  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,
  47. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  48. groups = -- comment
  49. {
  50. lava = 3,
  51. liquid = 2,
  52. igniter = 1,
  53. disable_jump = 1,
  54. melt_around = 3
  55. },
  56. on_blast = function(pos, intensity) end,
  57. on_player_walk_over = function(pos, player)
  58. if not gdac.player_is_admin(player) then
  59. local pname = player:get_player_name()
  60. if player:get_hp() > 0 and not heatdamage.is_immune(pname) then
  61. local pa = vector.add(pos, {x=0, y=1, z=0})
  62. if minetest.get_node(pa).name == "air" then
  63. minetest.add_node(pa, {name="fire:basic_flame"})
  64. end
  65. minetest.chat_send_all("# Server: <" .. rename.gpn(pname) .. "> walked on lava.")
  66. player:set_hp(0)
  67. end
  68. end
  69. end,
  70. on_collapse_to_entity = function(pos, node)
  71. -- Do not allow player to obtain the node itself.
  72. end,
  73. })
  74. minetest.register_node("lbrim:lava_flowing", {
  75. description = "Flowing Nether Lava",
  76. drawtype = "flowingliquid",
  77. tiles = {"lbrim_lava.png"},
  78. special_tiles = {
  79. {
  80. name = "lbrim_flowing.png",
  81. backface_culling = false,
  82. animation = {
  83. type = "vertical_frames",
  84. aspect_w = 16,
  85. aspect_h = 16,
  86. length = 3.3,
  87. },
  88. },
  89. {
  90. name = "lbrim_flowing.png",
  91. backface_culling = true,
  92. animation = {
  93. type = "vertical_frames",
  94. aspect_w = 16,
  95. aspect_h = 16,
  96. length = 3.3,
  97. },
  98. },
  99. },
  100. paramtype = "light",
  101. paramtype2 = "flowingliquid",
  102. light_source = default.LIGHT_MAX - 2,
  103. walkable = false,
  104. pointable = false,
  105. diggable = false,
  106. buildable_to = false,
  107. -- Liquids cannot be floodable.
  108. --floodable = true,
  109. is_ground_content = false,
  110. drop = "",
  111. drowning = 1,
  112. liquidtype = "flowing",
  113. liquid_alternative_flowing = "lbrim:lava_flowing",
  114. liquid_alternative_source = "lbrim:lava_source",
  115. liquid_viscosity = 7,
  116. liquid_renewable = true,
  117. damage_per_second = 16,
  118. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  119. groups = -- comment
  120. {
  121. lava = 3,
  122. liquid = 2,
  123. igniter = 1,
  124. not_in_creative_inventory = 1,
  125. disable_jump = 1,
  126. melt_around = 3
  127. },
  128. on_blast = function(pos, intensity) end,
  129. on_player_walk_over = function(pos, player)
  130. if not gdac.player_is_admin(player) then
  131. local pname = player:get_player_name()
  132. if player:get_hp() > 0 and not heatdamage.is_immune(pname) then
  133. local pa = vector.add(pos, {x=0, y=1, z=0})
  134. if minetest.get_node(pa).name == "air" then
  135. minetest.add_node(pa, {name="fire:basic_flame"})
  136. end
  137. minetest.chat_send_all("# Server: <" .. rename.gpn(pname) .. "> walked on lava.")
  138. player:set_hp(0)
  139. end
  140. end
  141. end,
  142. on_collapse_to_entity = function(pos, node)
  143. -- Do not allow player to obtain the node itself.
  144. end,
  145. })