init.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. minetest.register_node("morelights_modern:block", {
  2. description = "Modern Light Block",
  3. tiles = {"morelights_metal_dark.png^morelights_modern_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_modern:smallblock", {
  10. description = "Modern Light Block (small)",
  11. drawtype = "nodebox",
  12. node_box = {
  13. type = "fixed",
  14. fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4}
  15. },
  16. tiles = {"morelights_metal_dark.png^morelights_modern_smallblock.png",
  17. "morelights_metal_dark.png^morelights_modern_smallblock.png",
  18. "[combine:16x16:0,0=morelights_metal_dark.png:0,4=morelights_modern_smallblock.png"},
  19. paramtype = "light",
  20. paramtype2 = "facedir",
  21. light_source = 12,
  22. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  23. sounds = default.node_sound_glass_defaults(),
  24. on_place = function(itemstack, placer, pointed_thing)
  25. return morelights.rotate_and_place(itemstack, placer, pointed_thing)
  26. end,
  27. })
  28. morelights.register_variants({
  29. {name = "morelights_modern:post_d", description = "Modern Post Light (dark)",
  30. tiles = {"morelights_metal_dark.png", "morelights_metal_dark.png",
  31. "morelights_metal_dark.png^morelights_modern_post.png"}},
  32. {name = "morelights_modern:post_l", description = "Modern Post Light (light)",
  33. tiles = {"morelights_metal_light.png", "morelights_metal_light.png",
  34. "morelights_metal_light.png^morelights_modern_post.png"}}
  35. },
  36. {
  37. drawtype = "nodebox",
  38. node_box = {
  39. type = "fixed",
  40. fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}}
  41. },
  42. paramtype = "light",
  43. light_source = LIGHT_MAX,
  44. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  45. sounds = default.node_sound_metal_defaults(),
  46. })
  47. morelights.register_variants({
  48. {name = "morelights_modern:streetpost_d",
  49. description = "Street Lamp Post (dark)--connects to bar lights",
  50. tiles = {"morelights_metal_dark.png"}},
  51. {name = "morelights_modern:streetpost_l",
  52. description = "Street Lamp Post (light)--connects to bar lights",
  53. tiles = {"morelights_metal_light.png"}}
  54. },
  55. {
  56. drawtype = "nodebox",
  57. node_box = {
  58. type = "connected",
  59. fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
  60. connect_front = {-1/16, 3/8, -1/2, 1/16, 7/16, -1/16},
  61. connect_left = {-1/2, 3/8, -1/16, -1/16, 7/16, 1/16},
  62. connect_back = {-1/16, 3/8, 1/16, 1/16, 7/16, 1/2},
  63. connect_right = {1/16, 3/8, -1/16, 1/2, 7/16, 1/16},
  64. },
  65. connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s"},
  66. paramtype = "light",
  67. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  68. sounds = default.node_sound_metal_defaults(),
  69. })
  70. minetest.register_node("morelights_modern:barlight_c", {
  71. description = "Ceiling Bar Light (connecting)",
  72. drawtype = "nodebox",
  73. node_box = {
  74. type = "connected",
  75. fixed = {-1/8, 3/8, -1/8, 1/8, 1/2, 1/8},
  76. connect_front = {-1/8, 3/8, -1/2, 1/8, 1/2, -1/8},
  77. connect_left = {-1/2, 3/8, -1/8, -1/8, 1/2, 1/8},
  78. connect_back = {-1/8, 3/8, 1/8, 1/8, 1/2, 1/2},
  79. connect_right = {1/8, 3/8, -1/8, 1/2, 1/2, 1/8},
  80. },
  81. connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s",
  82. "morelights_modern:streetpost_d", "morelights_modern:streetpost_l"},
  83. tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png",
  84. "morelights_metal_dark.png"},
  85. paramtype = "light",
  86. light_source = LIGHT_MAX,
  87. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  88. sounds = default.node_sound_glass_defaults(),
  89. })
  90. minetest.register_node("morelights_modern:barlight_s", {
  91. description = "Ceiling Bar Light (straight)",
  92. drawtype = "nodebox",
  93. node_box = {
  94. type = "fixed",
  95. fixed = {-1/2, 3/8, -1/8, 1/2, 1/2, 1/8},
  96. },
  97. tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png",
  98. "morelights_metal_dark.png"},
  99. paramtype = "light",
  100. paramtype2 = "facedir",
  101. light_source = LIGHT_MAX,
  102. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  103. sounds = default.node_sound_glass_defaults(),
  104. })
  105. minetest.register_node("morelights_modern:ceilinglight", {
  106. description = "Modern Ceiling Light",
  107. drawtype = "nodebox",
  108. node_box = {
  109. type = "fixed",
  110. fixed = {-1/4, 3/8, -1/4, 1/4, 1/2, 1/4}
  111. },
  112. tiles = {"morelights_metal_dark.png",
  113. "morelights_metal_dark.png^morelights_modern_block.png"},
  114. paramtype = "light",
  115. paramtype2 = "facedir",
  116. light_source = LIGHT_MAX,
  117. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  118. sounds = default.node_sound_glass_defaults(),
  119. on_place = function(itemstack, placer, pointed_thing)
  120. return morelights.rotate_and_place(itemstack, placer, pointed_thing,
  121. {[0] = 0, 20, 12, 16, 4, 8})
  122. end,
  123. })
  124. morelights.register_variants({
  125. {name = "morelights_modern:canlight_d",
  126. description = "Modern Can Light (dark)",
  127. tiles = {"morelights_metal_dark.png^morelights_modern_canlight.png"}},
  128. {name = "morelights_modern:canlight_l",
  129. description = "Modern Can Light (light)",
  130. tiles = {"morelights_metal_light.png^morelights_modern_canlight.png"}},
  131. },
  132. {
  133. drawtype = "mesh",
  134. mesh = "morelights_modern_canlight.obj",
  135. collision_box = {
  136. type = "fixed",
  137. fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8}
  138. },
  139. selection_box = {
  140. type = "fixed",
  141. fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8}
  142. },
  143. paramtype = "light",
  144. light_source = 12,
  145. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  146. sounds = default.node_sound_metal_defaults(),
  147. })
  148. minetest.register_node("morelights_modern:walllamp", {
  149. description = "Modern Wall Lamp",
  150. drawtype = "mesh",
  151. mesh = "morelights_modern_walllamp.obj",
  152. collision_box = {
  153. type = "fixed",
  154. fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2}
  155. },
  156. selection_box = {
  157. type = "fixed",
  158. fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2}
  159. },
  160. tiles = {"morelights_metal_dark_32.png^morelights_modern_walllamp.png"},
  161. paramtype = "light",
  162. paramtype2 = "facedir",
  163. light_source = 12,
  164. groups = {cracky = 2, oddly_breakable_by_hand = 3},
  165. sounds = default.node_sound_glass_defaults(),
  166. on_place = function(itemstack, placer, pointed_thing)
  167. return morelights.rotate_and_place(itemstack, placer, pointed_thing,
  168. {[0] = 6, 4, 1, 3, 0, 2})
  169. end,
  170. })
  171. morelights.register_variants({
  172. {name = "morelights_modern:tablelamp_d",
  173. description = "Modern Table Lamp (dark)",
  174. tiles = {"morelights_metal_light_32.png^morelights_modern_tablelamp_o.png",
  175. "morelights_modern_tablelamp_d.png"}},
  176. {name = "morelights_modern:tablelamp_l",
  177. description = "Modern Table Lamp (light)",
  178. tiles = {"morelights_metal_dark_32.png^morelights_modern_tablelamp_o.png",
  179. "morelights_modern_tablelamp_l.png"}},
  180. },
  181. {
  182. drawtype = "mesh",
  183. mesh = "morelights_modern_tablelamp.obj",
  184. collision_box = {
  185. type = "fixed",
  186. fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4}
  187. },
  188. selection_box = {
  189. type = "fixed",
  190. fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4}
  191. },
  192. paramtype = "light",
  193. light_source = 10,
  194. groups = {choppy = 2, oddly_breakable_by_hand = 3},
  195. sounds = default.node_sound_defaults(),
  196. })
  197. morelights.register_variants({
  198. {name = "morelights_modern:pathlight_d",
  199. description = "Modern Path Light (dark)",
  200. tiles = {"morelights_metal_dark_32.png^morelights_modern_pathlight.png"}},
  201. {name = "morelights_modern:pathlight_l",
  202. description = "Modern Path Light (light)",
  203. tiles = {"morelights_metal_light_32.png^morelights_modern_pathlight.png"}}
  204. },
  205. {
  206. drawtype = "nodebox",
  207. node_box = {
  208. type = "fixed",
  209. fixed = {{-1/32, -8/16, -1/32, 1/32, 1/8, 1/32},
  210. {-1/16, 1/8, -1/16, 1/16, 5/16, 1/16},
  211. {-1/8, 5/16, -1/8, 1/8, 3/8, 1/8}}
  212. },
  213. selection_box = {
  214. type = "fixed",
  215. fixed = {{-1/8, -1/2, -1/8, 1/8, 3/8, 1/8}}
  216. },
  217. paramtype = "light",
  218. light_source = 8,
  219. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  220. sounds = default.node_sound_metal_defaults(),
  221. })
  222. --
  223. -- Craft recipes
  224. --
  225. minetest.register_craft({
  226. output = "morelights_modern:block",
  227. recipe = {
  228. {"", "default:steel_ingot", ""},
  229. {morelights.glass, "morelights:bulb", morelights.glass},
  230. {"", "default:steel_ingot", ""}
  231. }
  232. })
  233. minetest.register_craft({
  234. output = "morelights_modern:smallblock",
  235. recipe = {
  236. {"", morelights.glass, ""},
  237. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
  238. }
  239. })
  240. minetest.register_craft({
  241. output = "morelights_modern:post_d",
  242. recipe = {
  243. {"dye:dark_grey", "default:steel_ingot", ""},
  244. {"", "morelights:bulb", ""},
  245. {"", "default:steel_ingot", ""}
  246. }
  247. })
  248. minetest.register_craft({
  249. output = "morelights_modern:post_l",
  250. recipe = {
  251. {"dye:white", "default:steel_ingot", ""},
  252. {"", "morelights:bulb", ""},
  253. {"", "default:steel_ingot", ""}
  254. }
  255. })
  256. minetest.register_craft({
  257. output = "morelights_modern:streetpost_d 2",
  258. recipe = {
  259. {"dye:dark_grey", "default:steel_ingot", "default:steel_ingot"},
  260. {"", "default:steel_ingot", ""},
  261. {"", "default:steel_ingot", ""}
  262. }
  263. })
  264. minetest.register_craft({
  265. output = "morelights_modern:streetpost_l 2",
  266. recipe = {
  267. {"dye:white", "default:steel_ingot", "default:steel_ingot"},
  268. {"", "default:steel_ingot", ""},
  269. {"", "default:steel_ingot", ""}
  270. }
  271. })
  272. minetest.register_craft({
  273. output = "morelights_modern:barlight_c 4",
  274. recipe = {
  275. {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
  276. {"default:copper_ingot", "default:glass", "default:copper_ingot"}
  277. }
  278. })
  279. minetest.register_craft({
  280. output = "morelights_modern:barlight_c",
  281. type = "shapeless",
  282. recipe = {"morelights_modern:barlight_s"}
  283. })
  284. minetest.register_craft({
  285. output = "morelights_modern:barlight_s",
  286. type = "shapeless",
  287. recipe = {"morelights_modern:barlight_c"}
  288. })
  289. minetest.register_craft({
  290. output = "morelights_modern:ceilinglight",
  291. recipe = {
  292. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
  293. {"", morelights.glass, ""},
  294. }
  295. })
  296. minetest.register_craft({
  297. output = "morelights_modern:canlight_d",
  298. recipe = {
  299. {"dye:dark_grey", "default:steel_ingot", ""},
  300. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
  301. }
  302. })
  303. minetest.register_craft({
  304. output = "morelights_modern:canlight_l",
  305. recipe = {
  306. {"dye:white", "default:steel_ingot", ""},
  307. {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
  308. }
  309. })
  310. minetest.register_craft({
  311. output = "morelights_modern:walllamp",
  312. recipe = {
  313. {"dye:white", morelights.glass, ""},
  314. {morelights.glass, "morelights:bulb", "default:steel_ingot"},
  315. {"", "dye:dark_grey", "default:steel_ingot"}
  316. }
  317. })
  318. minetest.register_craft({
  319. output = "morelights_modern:tablelamp_d",
  320. recipe = {
  321. {"wool:dark_grey", "morelights:bulb", "wool:dark_grey"},
  322. {"", "default:steel_ingot", ""},
  323. {"", "default:steel_ingot", ""}
  324. }
  325. })
  326. minetest.register_craft({
  327. output = "morelights_modern:tablelamp_l",
  328. recipe = {
  329. {"wool:white", "morelights:bulb", "wool:white"},
  330. {"", "default:steel_ingot", ""},
  331. {"", "default:steel_ingot", ""}
  332. }
  333. })
  334. minetest.register_craft({
  335. output = "morelights_modern:pathlight_d",
  336. recipe = {
  337. {"dye:dark_grey", "morelights:bulb", ""},
  338. {"", "default:steel_ingot", ""},
  339. {"", "default:steel_ingot", ""}
  340. }
  341. })
  342. minetest.register_craft({
  343. output = "morelights_modern:pathlight_l",
  344. recipe = {
  345. {"dye:white", "morelights:bulb", ""},
  346. {"", "default:steel_ingot", ""},
  347. {"", "default:steel_ingot", ""}
  348. }
  349. })