perma_torch.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. minetest.register_node("torches:perma_torch_floor", {
  2. description = "Everlasting Torch",
  3. drawtype = "mesh",
  4. mesh = "torch_floor.obj",
  5. inventory_image = "default_torch_on_floor.png",
  6. wield_image = "default_torch_on_floor.png",
  7. tiles = {{
  8. name = "default_torch_on_floor_animated.png",
  9. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  10. }},
  11. paramtype = "light",
  12. paramtype2 = "wallmounted",
  13. sunlight_propagates = true,
  14. walkable = false,
  15. liquids_pointable = false,
  16. light_source = 12,
  17. groups = utility.dig_groups("item", {
  18. flammable=1,
  19. attached_node=1,
  20. torch=1,
  21. torch_craftitem=1,
  22. melt_around=2,
  23. notify_construct=1,
  24. want_notify=1,
  25. }),
  26. drop = "torches:perma_torch_floor",
  27. damage_per_second = 1*500, -- Torches damage if you stand on top of them.
  28. _damage_per_second_type = "heat",
  29. _death_message = "<player> stepped on a torch.",
  30. selection_box = {
  31. type = "wallmounted",
  32. wall_bottom = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
  33. },
  34. sounds = default.node_sound_wood_defaults(),
  35. _torches_node_floor = "torches:perma_torch_floor",
  36. _torches_node_wall = "torches:perma_torch_wall",
  37. _torches_node_ceiling = "torches:perma_torch_ceiling",
  38. on_place = function(...)
  39. return torches.put_torch(...)
  40. end,
  41. --[[
  42. on_use = function(...)
  43. return torches.on_use(...)
  44. end,
  45. --]]
  46. floodable = true,
  47. on_rotate = false,
  48. on_flood = function(pos, oldnode, newnode)
  49. minetest.add_node(pos, {name="air"})
  50. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  51. return true
  52. end,
  53. on_construct = function(pos)
  54. breath.ignite_nearby_gas(pos)
  55. flowers.create_lilyspawner_near(pos)
  56. torchmelt.start_melting(pos)
  57. end,
  58. on_notify = function(pos, other)
  59. torchmelt.start_melting(pos)
  60. end,
  61. on_destruct = function(pos)
  62. end,
  63. })
  64. minetest.register_node("torches:perma_torch_wall", {
  65. drawtype = "mesh",
  66. mesh = "torch_wall.obj",
  67. tiles = {{
  68. name = "default_torch_on_floor_animated.png",
  69. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  70. }},
  71. paramtype = "light",
  72. paramtype2 = "wallmounted",
  73. sunlight_propagates = true,
  74. walkable = false,
  75. light_source = 12,
  76. groups = utility.dig_groups("item", {
  77. flammable=1,
  78. not_in_creative_inventory=1,
  79. attached_node=1,
  80. torch=1,
  81. melt_around=2,
  82. notify_construct=1,
  83. want_notify=1,
  84. }),
  85. drop = "torches:perma_torch_floor",
  86. selection_box = {
  87. type = "wallmounted",
  88. wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
  89. },
  90. sounds = default.node_sound_wood_defaults(),
  91. floodable = true,
  92. on_rotate = false,
  93. on_flood = function(pos, oldnode, newnode)
  94. minetest.add_node(pos, {name="air"})
  95. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  96. return true
  97. end,
  98. on_construct = function(pos)
  99. breath.ignite_nearby_gas(pos)
  100. flowers.create_lilyspawner_near(pos)
  101. torchmelt.start_melting(pos)
  102. end,
  103. on_notify = function(pos, other)
  104. torchmelt.start_melting(pos)
  105. end,
  106. on_destruct = function(pos)
  107. end,
  108. })
  109. minetest.register_node("torches:perma_torch_ceiling", {
  110. drawtype = "mesh",
  111. mesh = "torch_ceiling.obj",
  112. tiles = {{
  113. name = "default_torch_on_floor_animated.png",
  114. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  115. }},
  116. paramtype = "light",
  117. paramtype2 = "wallmounted",
  118. sunlight_propagates = true,
  119. walkable = false,
  120. light_source = 12,
  121. groups = utility.dig_groups("item", {
  122. flammable=1,
  123. not_in_creative_inventory=1,
  124. attached_node=1,
  125. torch=1,
  126. melt_around=2,
  127. notify_construct=1,
  128. want_notify=1,
  129. }),
  130. drop = "torches:perma_torch_floor",
  131. selection_box = {
  132. type = "wallmounted",
  133. wall_top = {-0.1, -0.1, -0.25, 0.1, 0.5, 0.1},
  134. },
  135. sounds = default.node_sound_wood_defaults(),
  136. floodable = true,
  137. on_rotate = false,
  138. on_flood = function(pos, oldnode, newnode)
  139. minetest.add_node(pos, {name="air"})
  140. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  141. return true
  142. end,
  143. on_construct = function(pos)
  144. breath.ignite_nearby_gas(pos)
  145. flowers.create_lilyspawner_near(pos)
  146. torchmelt.start_melting(pos)
  147. end,
  148. on_notify = function(pos, other)
  149. torchmelt.start_melting(pos)
  150. end,
  151. on_destruct = function(pos)
  152. end,
  153. })
  154. minetest.register_craft({
  155. output = 'torches:perma_torch_floor 2',
  156. recipe = {
  157. {'mese_crystals:zentamine'},
  158. {'default:coal_lump'},
  159. {'group:stick'},
  160. }
  161. })
  162. minetest.register_craft({
  163. type = "fuel",
  164. recipe = "torches:perma_torch_floor",
  165. burntime = 4,
  166. })