init.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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:nether_brick", {
  43. description = "Nether Brick Light",
  44. tiles = {"nether_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:stairlight", {
  51. description = "Stair Light (place on stairs)",
  52. drawtype = "nodebox",
  53. node_box = {
  54. type = "fixed",
  55. fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
  56. },
  57. selection_box = {
  58. type = "fixed",
  59. fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
  60. },
  61. walkable = false,
  62. tiles = {"morelights_metal_dark.png"},
  63. overlay_tiles = {"", "morelights_extras_stairlight.png",
  64. "", "", "morelights_extras_stairlight.png"},
  65. paramtype = "light",
  66. paramtype2 = "facedir",
  67. light_source = 10,
  68. groups = {cracky = 2, oddly_breakable_by_hand = 3, attached_node = 1},
  69. node_placement_prediction = "",
  70. sounds = default.node_sound_glass_defaults(),
  71. on_place = function(itemstack, placer, pointed_thing)
  72. local node = minetest.get_node(vector.subtract(pointed_thing.above,
  73. {x=0, y=1, z=0}))
  74. if node and node.name:match("^stairs:stair") or node.name:match('^moreblocks:stair')
  75. or node.name:match("^darkage:stair") or node.name:match("^bakedclay:stair") and node.param2 < 4 then
  76. minetest.item_place(itemstack, placer, pointed_thing, node.param2)
  77. end
  78. return itemstack
  79. end,
  80. on_rotate = function(pos, node, user, mode, new_param2)
  81. return false
  82. end,
  83. })
  84. --
  85. -- Craft recipes
  86. --
  87. minetest.register_craft({
  88. output = "morelights_extras:f_block",
  89. recipe = {
  90. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"},
  91. {morelights.glass, "morelights:bulb", morelights.glass},
  92. {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"}
  93. }
  94. })
  95. minetest.register_craft({
  96. output = "morelights_extras:dirt_with_grass",
  97. recipe = {
  98. {"", morelights.glass, ""},
  99. {"", "morelights:bulb", ""},
  100. {"default:grass_1", "default:dirt", ""}
  101. }
  102. })
  103. minetest.register_craft({
  104. output = "morelights_extras:stone_block",
  105. recipe = {
  106. {"", morelights.glass, ""},
  107. {"", "morelights:bulb", ""},
  108. {"", "default:stone_block", ""}
  109. }
  110. })
  111. minetest.register_craft({
  112. output = "morelights_extras:sandstone_block",
  113. recipe = {
  114. {"", morelights.glass, ""},
  115. {"", "morelights:bulb", ""},
  116. {"", "default:sandstone_block", ""}
  117. }
  118. })
  119. minetest.register_craft({
  120. output = "morelights_extras:diamond_block",
  121. recipe = {
  122. {"", morelights.glass, ""},
  123. {"", "morelights:bulb", ""},
  124. {"", "default:diamondblock", ""}
  125. }
  126. })
  127. minetest.register_craft({
  128. output = "morelights_extras:nether_brick",
  129. recipe = {
  130. {"", morelights.glass, ""},
  131. {"", "morelights:bulb", ""},
  132. {"", "nether:brick", ""}
  133. }
  134. })
  135. minetest.register_craft({
  136. output = "morelights_extras:stairlight",
  137. recipe = {
  138. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
  139. }
  140. })