lamps.lua 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. minetest.register_craftitem("meseconductors:lamp_controller", {
  2. description = "Lamp Controller",
  3. inventory_image = "meseconductors_lamp_controller.png",
  4. })
  5. if minetest.get_modpath("technic") then
  6. minetest.register_craft({
  7. output = "meseconductors:lamp_controller",
  8. recipe = {
  9. { "mesecons_torch:mesecon_torch_on", "technic:control_logic_unit", "mesecons_torch:mesecon_torch_on"},
  10. { "", "mesecons:mesecon", ""}
  11. },
  12. })
  13. else
  14. minetest.register_craft({
  15. output = "meseconductors:lamp_controller",
  16. recipe = {
  17. { "mesecons_torch:mesecon_torch_on", "mesecons_luacontroller:luacontroller0000", "mesecons_torch:mesecon_torch_on"},
  18. { "", "mesecons:mesecon", ""}
  19. },
  20. })
  21. end
  22. lamp_box = {
  23. type = "wallmounted",
  24. wall_top = {-0.3275,0.375,-0.3275,0.3275,0.5,0.3275},
  25. wall_bottom = {-0.3275,-0.5,-0.3275,0.3275,-0.375,0.3275},
  26. wall_side = {-0.375,-0.3275,-0.3275,-0.5,0.3275,0.3275},
  27. }
  28. rules_all =
  29. {{x=0, y=0, z=-1},
  30. {x=1, y=0, z=0},
  31. {x=-1, y=0, z=0},
  32. {x=0, y=0, z=1},
  33. {x=1, y=1, z=0},
  34. {x=1, y=-1, z=0},
  35. {x=-1, y=1, z=0},
  36. {x=-1, y=-1, z=0},
  37. {x=0, y=1, z=1},
  38. {x=0, y=-1, z=1},
  39. {x=0, y=1, z=-1},
  40. {x=0, y=1, z=0},
  41. {x=0, y=-1, z=0},
  42. {x=0, y=-1, z=-1}}
  43. -- Node Definition
  44. --to do: rename .obj and texture
  45. minetest.register_node("meseconductors:mese_light_off", {
  46. drawtype = "mesh",
  47. mesh = "meseconductors_wall_lamp.obj",
  48. tiles = {"meseconductors_wall_lamp.png"},
  49. groups = {cracky=3},
  50. paramtype = "light",
  51. paramtype2 = "wallmounted",
  52. description = "Wall / Ceiling Lamp",
  53. selection_box = lamp_box,
  54. walkable = false,
  55. mesecons = {effector = {
  56. rules = rules_all,
  57. action_on = function (pos, node)
  58. minetest.swap_node(pos, {name = "meseconductors:mese_light_on", param2 = node.param2})
  59. --on_place = minetest.rotate_node
  60. end,
  61. }}
  62. })
  63. --to do: rename .obj and texture
  64. minetest.register_node("meseconductors:mese_light_on", {
  65. drawtype = "mesh",
  66. mesh = "meseconductors_wall_lamp.obj",
  67. tiles = {"meseconductors_wall_lamp_on.png"},
  68. groups = {cracky=3, not_in_creative_inventory=1},
  69. paramtype = "light",
  70. paramtype2 = "wallmounted",
  71. description = "Wall / Ceiling Lamp (On !!)",
  72. selection_box = lamp_box,
  73. walkable = false,
  74. --on_place = minetest.rotate_node,
  75. light_source = 15,
  76. drop = "meseconductors:mese_light_off",
  77. mesecons = {effector = {
  78. rules = rules_all,
  79. action_off = function (pos, node)
  80. minetest.swap_node(pos, {name = "meseconductors:mese_light_off", param2 = node.param2})
  81. end,
  82. }}
  83. })
  84. rules_lamp_standing =
  85. {{x=0, y=-1, z=0},
  86. {x=1, y=0, z=0},
  87. {x=-1, y=0, z=0},
  88. {x=0, y=0, z=-1},
  89. {x=0, y=0, z=1}}
  90. rules_lamp_side =
  91. {{x=1, y=0, z=0},
  92. {x=-1, y=0, z=0},
  93. {x=0, y=0, z=-1},
  94. {x=0, y=0, z=1}}
  95. minetest.register_node("meseconductors:sphere_lamp_standing_off", {
  96. drawtype = "mesh",
  97. mesh = "meseconductors_sphere_lamp_standing.obj",
  98. tiles = {"meseconductors_sphere_lamp_standing.png"},
  99. groups = {cracky=3},
  100. paramtype = "light",
  101. description = "Sphere Lamp",
  102. use_texture_alpha = true,
  103. selection_box = {
  104. type = "fixed",
  105. fixed = {-0.1200,-0.5,-0.1200,0.1200,0.185,0.1200},
  106. },
  107. walkable = false,
  108. mesecons = {effector = {
  109. rules = rules_lamp_standing,
  110. action_on = function (pos, node)
  111. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_standing_on", param2 = node.param2})
  112. --on_place = minetest.rotate_node
  113. end,
  114. }}
  115. })
  116. minetest.register_node("meseconductors:sphere_lamp_standing_on", {
  117. drawtype = "mesh",
  118. mesh = "meseconductors_sphere_lamp_standing.obj",
  119. tiles = {"meseconductors_sphere_lamp_standing.png"},
  120. groups = {cracky=3, not_in_creative_inventory=1},
  121. paramtype = "light",
  122. description = "Sphere Lamp (On)",
  123. use_texture_alpha = true,
  124. selection_box = {
  125. type = "fixed",
  126. fixed = {-0.1200,-0.5,-0.1200,0.1200,0.185,0.1200},
  127. },
  128. walkable = false,
  129. light_source = 12,
  130. on_place = minetest.rotate_node,
  131. drop = "meseconductors:sphere_lamp_standing_off",
  132. mesecons = {effector = {
  133. rules = rules_lamp_standing,
  134. action_off = function (pos, node)
  135. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_standing_off", param2 = node.param2})
  136. --on_place = minetest.rotate_node
  137. end,
  138. }}
  139. })
  140. minetest.register_node("meseconductors:sphere_lamp_standing_tall_off", {
  141. drawtype = "mesh",
  142. mesh = "meseconductors_sphere_lamp_standing2.obj",
  143. tiles = {"meseconductors_sphere_lamp_standing.png"},
  144. groups = {cracky=3},
  145. paramtype = "light",
  146. description = "Sphere Lamp",
  147. use_texture_alpha = true,
  148. selection_box = {
  149. type = "fixed",
  150. fixed = {-0.1200,-0.5,-0.1200,0.1200,0.660,0.1200},
  151. },
  152. walkable = false,
  153. mesecons = {effector = {
  154. rules = rules_lamp_standing,
  155. action_on = function (pos, node)
  156. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_standing_tall_on", param2 = node.param2})
  157. --on_place = minetest.rotate_node
  158. end,
  159. }}
  160. })
  161. minetest.register_node("meseconductors:sphere_lamp_standing_tall_on", {
  162. drawtype = "mesh",
  163. mesh = "meseconductors_sphere_lamp_standing2.obj",
  164. tiles = {"meseconductors_sphere_lamp_standing.png"},
  165. groups = {cracky=3, not_in_creative_inventory=1},
  166. paramtype = "light",
  167. description = "Sphere Lamp (On)",
  168. use_texture_alpha = true,
  169. selection_box = {
  170. type = "fixed",
  171. fixed = {-0.1200,-0.5,-0.1200,0.1200,0.660,0.1200},
  172. },
  173. walkable = false,
  174. light_source = 12,
  175. on_place = minetest.rotate_node,
  176. drop = "meseconductors:sphere_lamp_standing_tall_off",
  177. mesecons = {effector = {
  178. rules = rules_lamp_standing,
  179. action_off = function (pos, node)
  180. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_standing_tall_off", param2 = node.param2})
  181. --on_place = minetest.rotate_node
  182. end,
  183. }}
  184. })
  185. minetest.register_node("meseconductors:sphere_lamp_wall_off", {
  186. description = "Sphere Lamp",
  187. drawtype = "mesh",
  188. mesh = "meseconductors_sphere_lamp_wall.obj",
  189. tiles = {"meseconductors_sphere_lamp_standing.png"},
  190. use_texture_alpha = true,
  191. groups = {cracky=3},
  192. paramtype = "light",
  193. paramtype2 = "facedir",
  194. --on_place = minetest.rotate_node,
  195. selection_box = {
  196. type = "fixed",
  197. fixed = {-0.17,-0.26,-0.08,0.17,0.4,0.5},
  198. },
  199. walkable = false,
  200. mesecons = {effector = {
  201. rules = rules_lamp_side,
  202. action_on = function (pos, node)
  203. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_wall_on", param2 = node.param2})
  204. end,
  205. }}
  206. })
  207. minetest.register_node("meseconductors:sphere_lamp_wall_on", {
  208. description = "Sphere Lamp (On)",
  209. drawtype = "mesh",
  210. mesh = "meseconductors_sphere_lamp_wall.obj",
  211. tiles = {"meseconductors_sphere_lamp_standing.png"},
  212. use_texture_alpha = true,
  213. groups = {cracky=3, not_in_creative_inventory=1},
  214. paramtype = "light",
  215. paramtype2 = "facedir",
  216. selection_box = {
  217. type = "fixed",
  218. fixed = {-0.17,-0.26,-0.08,0.17,0.4,0.5},
  219. },
  220. walkable = false,
  221. light_source = 12,
  222. --on_place = minetest.rotate_node,
  223. drop = "meseconductors:sphere_lamp_wall_off",
  224. mesecons = {effector = {
  225. rules = rules_lamp_side,
  226. action_off = function (pos, node)
  227. minetest.swap_node(pos, {name = "meseconductors:sphere_lamp_wall_off", param2 = node.param2})
  228. end,
  229. }}
  230. })
  231. minetest.register_node("meseconductors:diamond_lamp_off", {
  232. description = "Diamond Lamp",
  233. drawtype = "mesh",
  234. mesh = "meseconductors_diamond_lamp.obj",
  235. tiles = {"meseconductors_diamond_lamp.png"},
  236. groups = {cracky=3},
  237. paramtype = "light",
  238. mesecons = {effector = {
  239. rules = rules_all,
  240. action_on = function (pos, node)
  241. minetest.swap_node(pos, {name = "meseconductors:diamond_lamp_on", param2 = node.param2})
  242. end,
  243. }}
  244. })
  245. minetest.register_node("meseconductors:diamond_lamp_on", {
  246. description = "Diamond Lamp",
  247. drawtype = "mesh",
  248. mesh = "meseconductors_diamond_lamp.obj",
  249. tiles = {"meseconductors_diamond_lamp_on.png"},
  250. groups = {cracky=3, not_in_creative_inventory=1},
  251. paramtype = "light",
  252. light_source = 14,
  253. drop = "meseconductors:diamond_lamp_off",
  254. mesecons = {effector = {
  255. rules = rules_all,
  256. action_off = function (pos, node)
  257. minetest.swap_node(pos, {name = "meseconductors:diamond_lamp_off", param2 = node.param2})
  258. end,
  259. }}
  260. })
  261. minetest.register_node("meseconductors:garden_lamp_off", {
  262. description = "Garden Lamp",
  263. drawtype = "mesh",
  264. mesh = "meseconductors_garden_lamp.obj",
  265. tiles = {"meseconductors_garden_lamp.png"},
  266. groups = {cracky=3},
  267. paramtype = "light",
  268. paramtype2 = "facedir",
  269. walkable = false,
  270. selection_box = {
  271. type = "fixed",
  272. fixed = {-0.1500,-0.5,-0.1500,0.1500,-0.1,0.1500},
  273. },
  274. mesecons = {effector = {
  275. rules = rules_lamp_standing,
  276. action_on = function (pos, node)
  277. minetest.swap_node(pos, {name = "meseconductors:garden_lamp_on", param2 = node.param2})
  278. end,
  279. }}
  280. })
  281. minetest.register_node("meseconductors:garden_lamp_on", {
  282. description = "Garden Lamp (on)",
  283. drawtype = "mesh",
  284. mesh = "meseconductors_garden_lamp.obj",
  285. tiles = {"meseconductors_garden_lamp_on.png"},
  286. groups = {cracky=3, not_in_creative_inventory=1},
  287. paramtype = "light",
  288. paramtype2 = "facedir",
  289. walkable = false,
  290. selection_box = {
  291. type = "fixed",
  292. fixed = {-0.1500,-0.5,-0.1500,0.1500,-0.1,0.1500},
  293. },
  294. light_source = 12,
  295. drop = "meseconductors:garden_lamp_off",
  296. mesecons = {effector = {
  297. rules = rules_lamp_standing,
  298. action_off = function (pos, node)
  299. minetest.swap_node(pos, {name = "meseconductors:garden_lamp_off", param2 = node.param2})
  300. end,
  301. }}
  302. })
  303. minetest.register_craft({
  304. output = "meseconductors:mese_light_off 2",
  305. recipe = {
  306. { "default:glass", "default:glass", "default:glass"},
  307. { "group:wood", "default:torch", "group:wood"},
  308. { "", "meseconductors:lamp_controller", ""}
  309. },
  310. })
  311. if minetest.get_modpath("homedecor") then
  312. minetest.register_craft({
  313. output = "meseconductors:sphere_lamp_standing_off 2",
  314. recipe = {
  315. { "default:glass", "default:torch", "default:glass"},
  316. { "", "homedecor:pole_wrought_iron", ""},
  317. { "homedecor:plastic_sheeting", "meseconductors:lamp_controller", "homedecor:plastic_sheeting"}
  318. },
  319. })
  320. minetest.register_craft({
  321. output = "meseconductors:diamond_lamp_off",
  322. recipe = {
  323. { "default:steel_ingot", "default:diamond", "default:obsidian_glass"},
  324. { "default:diamond", "homedecor:power_crystal", "default:diamond"},
  325. { "default:obsidian_glass", "meseconductors:lamp_controller", "default:steel_ingot"}
  326. },
  327. })
  328. minetest.register_craft({
  329. output = "meseconductors:garden_lamp_off 6",
  330. recipe = {
  331. { "default:obsidian_shard", "homedecor:glowlight_small_cube", "default:obsidian_shard"},
  332. { "", "default:steel_ingot", ""},
  333. { "", "meseconductors:lamp_controller", ""}
  334. },
  335. })
  336. minetest.register_craft({
  337. output = "meseconductors:sphere_lamp_standing_tall_off",
  338. recipe = {
  339. {"meseconductors:sphere_lamp_standing_off"},
  340. {"homedecor:pole_wrought_iron"}
  341. },
  342. })
  343. else
  344. minetest.register_craft({
  345. output = "meseconductors:sphere_lamp_standing_off 2",
  346. recipe = {
  347. { "default:glass", "default:torch", "default:glass"},
  348. { "", "default:steel_ingot", ""},
  349. { "default:paper", "meseconductors:lamp_controller", "default:paper"}
  350. },
  351. })
  352. minetest.register_craft({
  353. output = "meseconductors:sphere_lamp_standing_tall_off",
  354. recipe = {
  355. {"meseconductors:sphere_lamp_standing_off"},
  356. {"default:steel_ingot"}
  357. },
  358. })
  359. minetest.register_craft({
  360. output = "meseconductors:diamond_lamp_off",
  361. recipe = {
  362. { "default:steel_ingot", "default:diamond", "default:obsidian_glass"},
  363. { "default:diamond", "default:torch", "default:diamond"},
  364. { "default:obsidian_glass", "meseconductors:lamp_controller", "default:steel_ingot"}
  365. },
  366. })
  367. minetest.register_craft({
  368. output = "meseconductors:garden_lamp_off 6",
  369. recipe = {
  370. { "default:obsidian_shard", "default:torch", "default:obsidian_shard"},
  371. { "", "default:steel_ingot", ""},
  372. { "", "meseconductors:lamp_controller", ""}
  373. },
  374. })
  375. end
  376. minetest.register_craft({
  377. output = "meseconductors:sphere_lamp_wall_off",
  378. recipe = {
  379. {"default:steel_ingot", "meseconductors:sphere_lamp_standing_off"}
  380. },
  381. })
  382. function meseconductors:register_lamp(mod, node)
  383. if minetest.get_modpath(mod) then
  384. local node2 = node
  385. if minetest.registered_nodes[mod ..":"..node] == nil then
  386. print("[Meseconductors] - Warning: The mod " .. mod .." has no node ".. node .. " (anymore?)")
  387. return false
  388. end
  389. local offstate = "meseconductors:"..mod.."_"..node .. "_off"
  390. local onstate = "meseconductors:"..mod.."_"..node
  391. local description = minetest.registered_nodes[mod ..":"..node].description .. " (mesecons)"
  392. local description_on = minetest.registered_nodes[mod ..":"..node].description .. " (mesecons on)"
  393. local tiles = minetest.registered_nodes[mod ..":"..node].tiles
  394. local overlay_tiles = minetest.registered_nodes[mod ..":"..node].overlay_tiles
  395. local groups = table.copy(minetest.registered_nodes[mod ..":"..node].groups)
  396. if node == "lava_source" then
  397. groups = {snappy=3}
  398. description = "Fake Lava Source"
  399. description_on = "Fake Lava Source"
  400. end
  401. if node == "corium_source" then
  402. groups = {snappy=3}
  403. description = "Chernobylite Lamp"
  404. description_on = "Chernobylite Lamp"
  405. end
  406. local use_texture_alpha = minetest.registered_nodes[mod ..":"..node].use_texture_alpha
  407. local palette = minetest.registered_nodes[mod ..":"..node].palette
  408. local after_place_node = minetest.registered_nodes[mod ..":"..node].after_place_node
  409. local drawtype = minetest.registered_nodes[mod ..":"..node].drawtype
  410. local paramtype = minetest.registered_nodes[mod ..":"..node].paramtype
  411. local paramtype2 = minetest.registered_nodes[mod ..":"..node].paramtype2
  412. local sounds = minetest.registered_nodes[mod ..":"..node].sounds
  413. local sunlight_propagates = minetest.registered_nodes[mod ..":"..node].sunlight_propagates
  414. local light_source = minetest.registered_nodes[mod ..":"..node].light_source
  415. local selection_box = minetest.registered_nodes[mod ..":"..node].selection_box
  416. local collision_box = minetest.registered_nodes[mod ..":"..node].collision_box
  417. local node_box = minetest.registered_nodes[mod ..":"..node].node_box
  418. local on_place = minetest.registered_nodes[mod ..":"..node].on_place
  419. local mesh = minetest.registered_nodes[mod ..":"..node].mesh
  420. local wield_image = minetest.registered_nodes[mod ..":"..node].wield_image
  421. local inventory_image = minetest.registered_nodes[mod ..":"..node].inventory_image
  422. local walkable = minetest.registered_nodes[mod ..":"..node].walkable
  423. minetest.register_node(offstate, {
  424. tiles = tiles,
  425. overlay_tiles = overlay_tiles,
  426. description = description,
  427. use_texture_alpha = use_texture_alpha,
  428. drawtype = drawtype,
  429. paramtype = paramtype,
  430. paramtype2 = paramtype2,
  431. groups = groups,
  432. sounds = sounds,
  433. sunlight_propagates = sunlight_propagates,
  434. selection_box = selection_box,
  435. collision_box = collision_box,
  436. node_box = node_box,
  437. on_place = on_place,
  438. mesh = mesh,
  439. wield_image = wield_image,
  440. inventory_image = inventory_image,
  441. walkable = walkable,
  442. palette = palette,
  443. after_place_node = after_place_node,
  444. mesecons = {effector = {
  445. rules = rules_all,
  446. action_on = function (pos, node)
  447. minetest.swap_node(pos, {name = "meseconductors:"..mod.."_"..node2, param2 = node.param2})
  448. end,
  449. }}
  450. })
  451. local groups_on = table.copy(groups)
  452. groups_on["not_in_creative_inventory"] = 1
  453. minetest.register_node(onstate, {
  454. tiles = tiles,
  455. overlay_tiles = overlay_tiles,
  456. drop = offstate,
  457. description = description_on,
  458. use_texture_alpha = use_texture_alpha,
  459. drawtype = drawtype,
  460. groups = groups_on,
  461. paramtype = paramtype,
  462. paramtype2 = paramtype2,
  463. sounds = sounds,
  464. selection_box = selection_box,
  465. collision_box = collision_box,
  466. node_box = node_box,
  467. on_place = on_place,
  468. mesh = mesh,
  469. wield_image = wield_image,
  470. inventory_image = inventory_image,
  471. sunlight_propagates = sunlight_propagates,
  472. light_source = light_source,
  473. walkable = walkable,
  474. palette = palette,
  475. after_place_node = after_place_node,
  476. mesecons = {effector = {
  477. rules = rules_all,
  478. action_off = function (pos, node)
  479. minetest.swap_node(pos, {name = "meseconductors:"..mod.."_"..node2.."_off", param2 = node.param2})
  480. end,
  481. }}
  482. })
  483. end
  484. end
  485. meseconductors:register_lamp("default", "meselamp")
  486. meseconductors:register_lamp("default", "mese_post_light")
  487. meseconductors:register_lamp("ethereal", "glostone")
  488. meseconductors:register_lamp("homedecor", "glowlight_half")
  489. meseconductors:register_lamp("homedecor", "glowlight_quarter")
  490. meseconductors:register_lamp("homedecor", "glowlight_small_cube")
  491. meseconductors:register_lamp("homedecor", "lattice_lantern_large")
  492. meseconductors:register_lamp("homedecor", "lattice_lantern_small")
  493. meseconductors:register_lamp("homedecor", "ceiling_lamp")
  494. meseconductors:register_lamp("default", "lava_source")
  495. meseconductors:register_lamp("technic", "corium_source")
  496. meseconductors:register_lamp("castle", "light")
  497. minetest.register_craft({
  498. output = "meseconductors:default_lava_source_off",
  499. recipe = {
  500. { "", "default:obsidian_glass", ""},
  501. { "default:obsidian_glass", "bucket:bucket_lava", "default:obsidian_glass"},
  502. { "", "default:obsidian_glass", ""},
  503. },
  504. replacements = {
  505. {"bucket:bucket_lava", "bucket:bucket_empty"}
  506. }
  507. })
  508. if minetest.get_modpath("technic") then
  509. minetest.register_craft({
  510. output = "meseconductors:technic_corium_source_off",
  511. recipe = {
  512. { "", "technic:uranium_ingot", ""},
  513. { "technic:uranium_ingot", "bucket:bucket_lava", "technic:uranium_ingot"},
  514. { "", "technic:uranium_ingot", ""},
  515. },
  516. replacements = {
  517. {"bucket:bucket_lava", "bucket:bucket_empty"}
  518. }
  519. })
  520. minetest.register_craft({
  521. output = "meseconductors:technic_corium_source_off",
  522. recipe = {
  523. { "", "default:glass", ""},
  524. { "default:glass", "technic:bucket_corium", "default:glass"},
  525. { "", "default:glass", ""},
  526. },
  527. replacements = {
  528. {"bucket_corium", "bucket:bucket_empty"}
  529. }
  530. })
  531. end
  532. minetest.register_craft({
  533. output = "meseconductors:default_meselamp_off",
  534. recipe = {
  535. { "default:glass", "meseconductors:lamp_controller"},
  536. { "default:mese_crystal", ""}
  537. },
  538. })
  539. minetest.register_craft({
  540. output = "meseconductors:default_mese_post_light_off",
  541. type = "shapeless",
  542. recipe = {"default:mese_post_light", "meseconductors:lamp_controller"},
  543. })
  544. minetest.register_craft({
  545. output = "meseconductors:default_mese_post_light_off",
  546. recipe = {
  547. { "meseconductors:lamp_controller", "default:glass", ""},
  548. { "default:mese_crystal", "default:mese_crystal", "default:mese_crystal"},
  549. { "", "group:wood", ""}
  550. },
  551. })
  552. minetest.register_craft({
  553. output = "meseconductors:default_meselamp_off",
  554. type = "shapeless",
  555. recipe = {"default:meselamp", "meseconductors:lamp_controller"},
  556. })
  557. if minetest.get_modpath("ethereal") then
  558. minetest.register_craft({
  559. output = "meseconductors:ethereal_glostone_off",
  560. recipe = {
  561. { "default:torch", "default:stone", "dye:yellow"},
  562. { "", "meseconductors:lamp_controller", ""}
  563. },
  564. })
  565. minetest.register_craft({
  566. output = "meseconductors:ethereal_glostone_off",
  567. type = "shapeless",
  568. recipe = {"ethereal:glostone", "meseconductors:lamp_controller"},
  569. })
  570. end
  571. if minetest.get_modpath("castle") then
  572. minetest.register_craft({
  573. output = "meseconductors:castle_light_off",
  574. recipe = {
  575. { "default:stick", "default:glass", "default:stick"},
  576. { "default:glass", "default:torch", "default:glass"},
  577. { "default:stick", "meseconductors:lamp_controller", "default:stick"}
  578. },
  579. })
  580. minetest.register_craft({
  581. output = "meseconductors:castle_light_off",
  582. type = "shapeless",
  583. recipe = {"castle:light", "meseconductors:lamp_controller"},
  584. })
  585. end
  586. if minetest.get_modpath("homedecor") then
  587. minetest.register_craft({
  588. output = "meseconductors:homedecor_glowlight_half_off 6",
  589. recipe = {
  590. { "dye:white", "dye:white", "dye:white"},
  591. { "default:glass", "homedecor:power_crystal", "default:glass"},
  592. { "", "meseconductors:lamp_controller", ""}
  593. },
  594. })
  595. minetest.register_craft({
  596. output = "meseconductors:homedecor_glowlight_half_off",
  597. type = "shapeless",
  598. recipe = {"homedecor:glowlight_half", "meseconductors:lamp_controller"},
  599. })
  600. minetest.register_craft({
  601. output = "meseconductors:homedecor_glowlight_quarter_off",
  602. type = "shapeless",
  603. recipe = {"homedecor:glowlight_quarter", "meseconductors:lamp_controller"},
  604. })
  605. minetest.register_craft({
  606. output = "meseconductors:homedecor_glowlight_small_cube_off",
  607. type = "shapeless",
  608. recipe = {"homedecor:glowlight_small_cube", "meseconductors:lamp_controller"},
  609. })
  610. minetest.register_craft({
  611. output = "meseconductors:homedecor_glowlight_small_cube_off 8",
  612. recipe = {
  613. { "", "", ""},
  614. { "default:glass", "homedecor:power_crystal", "default:glass"},
  615. { "dye:white", "meseconductors:lamp_controller", "dye:white"}
  616. },
  617. })
  618. minetest.register_craft({
  619. output = "meseconductors:homedecor_lattice_lantern_large_off 2",
  620. recipe = {
  621. { "dye:black", "dye:yellow", "dye:black"},
  622. { "default:stick", "meseconductors:lamp_controller", "default:stick"},
  623. { "default:stick", "homedecor:power_crystal", "default:stick"}
  624. },
  625. })
  626. minetest.register_craft({
  627. output = "meseconductors:homedecor_lattice_lantern_large_off",
  628. type = "shapeless",
  629. recipe = {"homedecor:lattice_lantern_large", "meseconductors:lamp_controller"},
  630. })
  631. minetest.register_craft({
  632. output = "meseconductors:homedecor_lattice_lantern_small_off",
  633. type = "shapeless",
  634. recipe = {"homedecor:lattice_lantern_small", "meseconductors:lamp_controller"},
  635. })
  636. minetest.register_craft({
  637. output = "meseconductors:homedecor_lattice_lantern_small_off 8",
  638. recipe = {
  639. { "dye:black", "dye:yellow", "dye:black"},
  640. { "default:stick", "meseconductors:lamp_controller", "default:stick"},
  641. { "default:glass", "homedecor:power_crystal", "default:glass"}
  642. },
  643. })
  644. minetest.register_craft({
  645. output = "meseconductors:homedecor_ceiling_lamp_off",
  646. recipe = {
  647. { "", "chains:chain_top_brass", ""},
  648. { "default:glass", "meseconductors:homedecor_glowlight_small_cube_off", "default:glass"}
  649. },
  650. })
  651. minetest.register_craft({
  652. output = "meseconductors:homedecor_ceiling_lamp_off",
  653. type = "shapeless",
  654. recipe = {"homedecor:ceiling_lamp", "meseconductors:lamp_controller"},
  655. })
  656. if minetest.get_modpath("technic") then
  657. minetest.register_craft({
  658. output = "meseconductors:homedecor_ceiling_lamp_off",
  659. recipe = {
  660. { "", "technic:brass_ingot", ""},
  661. { "", "homedecor:chainlink_brass", ""},
  662. { "default:glass", "meseconductors:homedecor_glowlight_small_off", "default:glass"}
  663. },
  664. })
  665. end
  666. end