init.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. minetest.register_node("morelights_extras:f_block", {
  2. description = "Futuristic Light Block",
  3. tiles = {"morelights_extras_f_block.png"},
  4. paramtype = "light",
  5. light_source = LIGHT_MAX,
  6. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  7. sounds = default.node_sound_glass_defaults(),
  8. })
  9. minetest.register_node("morelights_extras:dirt_with_grass", {
  10. description = "Grass Light",
  11. tiles = {"default_grass.png^morelights_extras_blocklight.png",
  12. "default_dirt.png", "default_dirt.png^default_grass_side.png"},
  13. paramtype = "light",
  14. light_source = 12,
  15. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  16. sounds = default.node_sound_glass_defaults()
  17. })
  18. minetest.register_node("morelights_extras:stone_block", {
  19. description = "Stone Block Light",
  20. tiles = {"default_stone_block.png^morelights_extras_blocklight.png"},
  21. paramtype = "light",
  22. light_source = 12,
  23. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  24. sounds = default.node_sound_glass_defaults()
  25. })
  26. minetest.register_node("morelights_extras:sandstone_block", {
  27. description = "Sandstone Block Light",
  28. tiles = {"default_sandstone_block.png^morelights_extras_blocklight.png"},
  29. paramtype = "light",
  30. light_source = 12,
  31. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  32. sounds = default.node_sound_glass_defaults()
  33. })
  34. minetest.register_node("morelights_extras:diamond_block", {
  35. description = "Diamond Block Light",
  36. tiles = {"default_diamond_block.png^morelights_extras_blocklight.png"},
  37. paramtype = "light",
  38. light_source = 12,
  39. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  40. sounds = default.node_sound_glass_defaults()
  41. })
  42. minetest.register_node("morelights_extras:obsidian_brick", {
  43. description = "Obsidian Brick Light",
  44. tiles = {"default_obsidian_brick.png^morelights_extras_blocklight.png"},
  45. paramtype = "light",
  46. light_source = 12,
  47. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  48. sounds = default.node_sound_glass_defaults()
  49. })
  50. minetest.register_node("morelights_extras:sandstone_brick", {
  51. description = "Sandstone Brick Light",
  52. tiles = {"default_sandstone_brick.png^morelights_extras_blocklight.png"},
  53. paramtype = "light",
  54. light_source = 12,
  55. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  56. sounds = default.node_sound_glass_defaults()
  57. })
  58. minetest.register_node("morelights_extras:silver_sandstone_brick", {
  59. description = "Silver Sandstone Brick Light",
  60. tiles = {"default_silver_sandstone_brick.png^morelights_extras_blocklight.png"},
  61. paramtype = "light",
  62. light_source = 12,
  63. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  64. sounds = default.node_sound_glass_defaults()
  65. })
  66. minetest.register_node("morelights_extras:nether_brick", {
  67. description = "Nether Brick Light",
  68. tiles = {"nether_brick.png^morelights_extras_blocklight.png"},
  69. paramtype = "light",
  70. light_source = 12,
  71. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  72. sounds = default.node_sound_glass_defaults()
  73. })
  74. minetest.register_node("morelights_extras:stairlight", {
  75. description = "Stair Light (place on stairs)",
  76. drawtype = "nodebox",
  77. node_box = {
  78. type = "fixed",
  79. fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
  80. },
  81. selection_box = {
  82. type = "fixed",
  83. fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
  84. },
  85. walkable = false,
  86. tiles = {"morelights_metal_dark.png"},
  87. overlay_tiles = {"", "morelights_extras_stairlight.png",
  88. "", "", "morelights_extras_stairlight.png"},
  89. paramtype = "light",
  90. paramtype2 = "facedir",
  91. light_source = 10,
  92. groups = {cracky = 2, oddly_breakable_by_hand = 3, attached_node = 1},
  93. node_placement_prediction = "",
  94. sounds = default.node_sound_glass_defaults(),
  95. on_place = function(itemstack, placer, pointed_thing)
  96. local node = minetest.get_node(vector.subtract(pointed_thing.above,
  97. {x=0, y=1, z=0}))
  98. if node and node.name:match("^stairs:stair") or node.name:match('^moreblocks:stair')
  99. or node.name:match("^darkage:stair") or node.name:match("^bakedclay:stair") or node.name:match("^ocean:stair")
  100. and node.param2 < 4 then
  101. minetest.item_place(itemstack, placer, pointed_thing, node.param2)
  102. end
  103. return itemstack
  104. end,
  105. on_rotate = function(pos, node, user, mode, new_param2)
  106. return false
  107. end,
  108. })
  109. --
  110. -- Craft recipes
  111. --
  112. minetest.register_craft({
  113. output = "morelights_extras:f_block",
  114. recipe = {
  115. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"},
  116. {morelights.glass, "morelights:bulb", morelights.glass},
  117. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"}
  118. }
  119. })
  120. minetest.register_craft({
  121. output = "morelights_extras:dirt_with_grass",
  122. recipe = {
  123. {"", morelights.glass, ""},
  124. {"", "morelights:bulb", ""},
  125. {"default:grass_1", "default:dirt", ""}
  126. }
  127. })
  128. minetest.register_craft({
  129. output = "morelights_extras:stone_block",
  130. recipe = {
  131. {"", morelights.glass, ""},
  132. {"", "morelights:bulb", ""},
  133. {"", "default:stone_block", ""}
  134. }
  135. })
  136. minetest.register_craft({
  137. output = "morelights_extras:sandstone_block",
  138. recipe = {
  139. {"", morelights.glass, ""},
  140. {"", "morelights:bulb", ""},
  141. {"", "default:sandstone_block", ""}
  142. }
  143. })
  144. minetest.register_craft({
  145. output = "morelights_extras:diamond_block",
  146. recipe = {
  147. {"", morelights.glass, ""},
  148. {"", "morelights:bulb", ""},
  149. {"", "default:diamondblock", ""}
  150. }
  151. })
  152. minetest.register_craft({
  153. output = "morelights_extras:obsidian_brick",
  154. recipe = {
  155. {"", morelights.glass, ""},
  156. {"", "morelights:bulb", ""},
  157. {"", "default:obsidianbrick", ""}
  158. }
  159. })
  160. minetest.register_craft({
  161. output = "morelights_extras:sandstone_brick",
  162. recipe = {
  163. {"", morelights.glass, ""},
  164. {"", "morelights:bulb", ""},
  165. {"", "default:sandstonebrick", ""}
  166. }
  167. })
  168. minetest.register_craft({
  169. output = "morelights_extras:silver_sandstone_brick",
  170. recipe = {
  171. {"", morelights.glass, ""},
  172. {"", "morelights:bulb", ""},
  173. {"", "default:silver_sandstone_brick", ""}
  174. }
  175. })
  176. minetest.register_craft({
  177. output = "morelights_extras:nether_brick",
  178. recipe = {
  179. {"", morelights.glass, ""},
  180. {"", "morelights:bulb", ""},
  181. {"", "nether:brick", ""}
  182. }
  183. })
  184. minetest.register_craft({
  185. output = "morelights_extras:stairlight",
  186. recipe = {
  187. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
  188. }
  189. })