init.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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") and node.param2 < 4 then
  100. minetest.item_place(itemstack, placer, pointed_thing, node.param2)
  101. end
  102. return itemstack
  103. end,
  104. on_rotate = function(pos, node, user, mode, new_param2)
  105. return false
  106. end,
  107. })
  108. --
  109. -- Craft recipes
  110. --
  111. minetest.register_craft({
  112. output = "morelights_extras:f_block",
  113. recipe = {
  114. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"},
  115. {morelights.glass, "morelights:bulb", morelights.glass},
  116. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"}
  117. }
  118. })
  119. minetest.register_craft({
  120. output = "morelights_extras:dirt_with_grass",
  121. recipe = {
  122. {"", morelights.glass, ""},
  123. {"", "morelights:bulb", ""},
  124. {"default:grass_1", "default:dirt", ""}
  125. }
  126. })
  127. minetest.register_craft({
  128. output = "morelights_extras:stone_block",
  129. recipe = {
  130. {"", morelights.glass, ""},
  131. {"", "morelights:bulb", ""},
  132. {"", "default:stone_block", ""}
  133. }
  134. })
  135. minetest.register_craft({
  136. output = "morelights_extras:sandstone_block",
  137. recipe = {
  138. {"", morelights.glass, ""},
  139. {"", "morelights:bulb", ""},
  140. {"", "default:sandstone_block", ""}
  141. }
  142. })
  143. minetest.register_craft({
  144. output = "morelights_extras:diamond_block",
  145. recipe = {
  146. {"", morelights.glass, ""},
  147. {"", "morelights:bulb", ""},
  148. {"", "default:diamondblock", ""}
  149. }
  150. })
  151. minetest.register_craft({
  152. output = "morelights_extras:obsidian_brick",
  153. recipe = {
  154. {"", morelights.glass, ""},
  155. {"", "morelights:bulb", ""},
  156. {"", "default:obsidianbrick", ""}
  157. }
  158. })
  159. minetest.register_craft({
  160. output = "morelights_extras:sandstone_brick",
  161. recipe = {
  162. {"", morelights.glass, ""},
  163. {"", "morelights:bulb", ""},
  164. {"", "default:sandstonebrick", ""}
  165. }
  166. })
  167. minetest.register_craft({
  168. output = "morelights_extras:silver_sandstone_brick",
  169. recipe = {
  170. {"", morelights.glass, ""},
  171. {"", "morelights:bulb", ""},
  172. {"", "default:silver_sandstone_brick", ""}
  173. }
  174. })
  175. minetest.register_craft({
  176. output = "morelights_extras:nether_brick",
  177. recipe = {
  178. {"", morelights.glass, ""},
  179. {"", "morelights:bulb", ""},
  180. {"", "nether:brick", ""}
  181. }
  182. })
  183. minetest.register_craft({
  184. output = "morelights_extras:stairlight",
  185. recipe = {
  186. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
  187. }
  188. })