crafting.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. --node, mod, type
  2. local node_list = {
  3. {"wood", "default", "wood"},
  4. {"tree", "default", "wood"},
  5. {"dirt", "default", "soft"},
  6. {"cobble", "default", "stone"},
  7. {"desert_cobble", "default", "stone"},
  8. {"sand", "default", "soft"},
  9. {"desert_sand", "default", "soft"},
  10. {"stone", "default", "stone"},
  11. {"desert_stone", "default", "stone"},
  12. {"goldblock", "default", "block"},
  13. {"diamondblock", "default", "block"},
  14. {"jungletree", "default", "wood"},
  15. {"junglewood", "default", "wood"},
  16. {"mossycobble", "default", "stone"},
  17. {"obsidian", "default", "stone"},
  18. {"obsidian_glass", "default", "glass"},
  19. {"glass", "default", "glass"},
  20. {"sandstone", "default", "stone"},
  21. {"sandstonebrick", "default", "stone"},
  22. {"stonebrick", "default", "stone"},
  23. {"pine_tree", "default", "wood"},
  24. {"pine_wood", "default", "wood"},
  25. {"acacia_tree", "default", "wood"},
  26. {"acacia_wood", "default", "wood"},
  27. {"brick", "default", "stone"},
  28. {"cactus", "default", "wood"},
  29. {"aspen_tree", "default", "wood"},
  30. {"aspen_wood", "default", "wood"},
  31. {"snowblock", "default", "soft"},
  32. {"gravel", "default", "soft"},
  33. {"copperblock", "default", "block"},
  34. {"obsidianbrick", "default", "stone"},
  35. {"stone_block", "default", "stone"},
  36. {"desert_stone_block", "default", "stone"},
  37. {"obsidian_block", "default", "stone"},
  38. {"sandstone_block", "default", "stone"},
  39. {"clay", "default", "soft"},
  40. {"desert_stonebrick", "default", "stone"},
  41. {"desert_sandstone", "default", "stone"},
  42. {"desert_sandstone_brick", "default", "stone"},
  43. {"desert_sandstone_block", "default", "stone"},
  44. {"silver_sandstone", "default", "stone"},
  45. {"silver_sandstone_brick", "default", "stone"},
  46. {"silver_sandstone_block", "default", "stone"},
  47. {"silver_sand", "default", "soft"},
  48. {"ice", "default", "glass"},
  49. {"bronzeblock", "default", "block"},
  50. {"super_glow_glass", "moreblocks", "glass"},
  51. {"glow_glass", "moreblocks", "glass"},
  52. {"iron_stone_bricks", "moreblocks", "stone"},
  53. {"grey_bricks", "moreblocks", "stone"},
  54. {"clean_glass", "moreblocks", "glass"},
  55. {"cactus_brick", "moreblocks", "stone"},
  56. {"stone_tile", "moreblocks", "stone"},
  57. {"split_stone_tile", "moreblocks", "stone"},
  58. {"wood_tile", "moreblocks", "wood"},
  59. {"wood_tile_full", "moreblocks", "wood"},
  60. {"cactus_checker", "moreblocks", "block"},
  61. {"circle_stone_bricks", "moreblocks", "block"},
  62. {"coal_checker", "moreblocks", "block"},
  63. {"coal_glass", "moreblocks", "glass"},
  64. {"coal_stone", "moreblocks", "stone"},
  65. {"coal_stone_bricks", "moreblocks", "stone"},
  66. {"iron_checker", "moreblocks", "block"},
  67. {"iron_glass", "moreblocks", "glass"},
  68. {"iron_stone", "moreblocks", "stone"},
  69. {"plankstone", "moreblocks", "stone"},
  70. {"split_stone_tile_alt", "moreblocks", "stone"},
  71. {"all_faces_jungle_tree", "moreblocks", "wood"},
  72. {"all_faces_tree", "moreblocks", "wood"},
  73. {"cobble_compressed", "moreblocks", "stone"},
  74. {"copperpatina", "moreblocks", "block"},
  75. {"Adobe", "building_blocks", "soft"},
  76. {"hardwood", "building_blocks", "wood"},
  77. {"Tar", "building_blocks", "soft"},
  78. {"grate", "building_blocks", "block"},
  79. {"Marble", "building_blocks", "stone"},
  80. {"woodglass", "building_blocks", "glass"},
  81. {"smoothglass", "building_blocks", "glass"},
  82. --support old nodes for quartz
  83. {"block", "quartz", "block"},
  84. {"chiseled", "quartz", "block"},
  85. {"pillar", "quartz", "block"},
  86. --and new ones!!!
  87. {"quartzblock", "quartz", "block"},
  88. {"polish_quartz", "quartz", "block"},
  89. {"quartzbrick", "quartz", "block"},
  90. {"crystal_glass", "glooptest", "glass"},
  91. {"reinforced_crystal_glass", "glooptest", "glass"},
  92. {"akalin_crystal_glass", "glooptest", "glass"},
  93. {"alatro_crystal_glass", "glooptest", "glass"},
  94. {"arol_crystal_glass", "glooptest", "glass"},
  95. {"talinite_crystal_glass", "glooptest", "glass"},
  96. {"rainbow_block", "gloopblocks", "block"},
  97. {"cement", "gloopblocks", "stone"},
  98. {"pavement", "gloopblocks", "stone"},
  99. {"stone_mossy", "gloopblocks", "stone"},
  100. {"basalt", "gloopblocks", "stone"},
  101. {"cobble_road", "gloopblocks", "stone"},
  102. {"cobble_road_mossy", "gloopblocks", "stone"},
  103. {"evil_block", "gloopblocks", "block"},
  104. {"pumice", "gloopblocks", "stone"},
  105. {"scaffolding", "gloopblocks", "wood"},
  106. {"beech_trunk", "moretrees", "wood"},
  107. {"beech_planks", "moretrees", "wood"},
  108. {"apple_tree_trunk", "moretrees", "wood"},
  109. {"apple_tree_planks", "moretrees", "wood"},
  110. {"oak_trunk", "moretrees", "wood"},
  111. {"oak_planks", "moretrees", "wood"},
  112. {"sequoia_trunk", "moretrees", "wood"},
  113. {"sequoia_planks", "moretrees", "wood"},
  114. {"birch_trunk", "moretrees", "wood"},
  115. {"birch_planks", "moretrees", "wood"},
  116. {"palm_trunk", "moretrees", "wood"},
  117. {"palm_planks", "moretrees", "wood"},
  118. {"willow_trunk", "moretrees", "wood"},
  119. {"willow_planks", "moretrees", "wood"},
  120. {"palm_trunk", "moretrees", "wood"},
  121. {"palm_planks", "moretrees", "wood"},
  122. {"rubber_tree_trunk", "moretrees", "wood"},
  123. {"rubber_tree_planks", "moretrees", "wood"},
  124. {"fir_trunk", "moretrees", "wood"},
  125. {"fir_planks", "moretrees", "wood"},
  126. {"spruce_trunk", "moretrees", "wood"},
  127. {"spruce_planks", "moretrees", "wood"},
  128. {"cedar_trunk", "moretrees", "wood"},
  129. {"cedar_planks", "moretrees", "wood"},
  130. {"date_palm_trunk", "moretrees", "wood"},
  131. {"date_palm_planks", "moretrees", "wood"},
  132. {"poplar_trunk", "moretrees", "wood"},
  133. {"poplar_planks", "moretrees", "wood"},
  134. {"brass_block", "technic", "block"},
  135. {"carbon_steel_block", "technic", "block"},
  136. {"cast_iron_block", "technic", "block"},
  137. {"chromium_block", "technic", "block"},
  138. {"concrete", "technic", "block"},
  139. {"granite", "technic", "stone"},
  140. {"marble", "technic", "stone"},
  141. {"marble_bricks", "technic", "stone"},
  142. {"zinc_block", "technic", "block"},
  143. {"lead_block", "technic", "block"},
  144. {"blast_resistant_concrete", "technic", "block"},
  145. {"stainless_steel_block", "technic", "block"},
  146. {"uranium_block", "technic", "block"},
  147. {"banana_trunk", "ethereal", "wood"},
  148. {"banana_wood", "ethereal", "wood"},
  149. {"birch_trunk", "ethereal", "wood"},
  150. {"birch_wood", "ethereal", "wood"},
  151. {"bush", "ethereal", "soft"},
  152. {"crystal_block", "ethereal", "block"},
  153. {"crystal_moss", "ethereal", "soft"},
  154. {"dry_dirt", "ethereal", "soft"},
  155. {"fiery_moss", "ethereal", "soft"},
  156. {"frost_tree", "ethereal", "wood"},
  157. {"frost_wood", "ethereal", "wood"},
  158. {"gray_moss", "ethereal", "soft"},
  159. {"green_moss", "ethereal", "soft"},
  160. {"icebrick", "ethereal", "stone"},
  161. {"mushroom", "ethereal", "wood"},
  162. {"mushroom_moss", "ethereal", "soft"},
  163. {"mushroom_pore", "ethereal", "wood"},
  164. {"mushroom_trunk", "ethereal", "wood"},
  165. {"palm_trunk", "ethereal", "wood"},
  166. {"palm_wood", "ethereal", "wood"},
  167. {"redwood_trunk", "ethereal", "wood"},
  168. {"redwood_wood", "ethereal", "wood"},
  169. {"scorched_tree", "ethereal", "wood"},
  170. {"snowbrick", "ethereal", "stone"},
  171. {"willow_trunk", "ethereal", "wood"},
  172. {"willow_wood", "ethereal", "wood"},
  173. {"yellow_trunk", "ethereal", "wood"},
  174. {"yellow_wood", "ethereal", "wood"},
  175. {"mithril_block", "moreores", "block"},
  176. {"tin_block", "moreores", "block"},
  177. {"silver_block", "moreores", "block"},
  178. {"pavement_brick", "castle", "stone"},
  179. {"dungeon_stone", "castle", "stone"},
  180. {"rubble", "castle", "soft"},
  181. {"stonewall", "castle", "stone"},
  182. {"stonewall_corner", "castle", "stone"}
  183. }
  184. local node_list2 = {
  185. {"dirt_with_grass", "default", "default:grass_1"},
  186. {"dirt_with_snow", "default", "default:snow"},
  187. {"dirt_with_rainforest_litter", "default", "default:junglegrass"},
  188. {"dirt_with_dry_grass", "default", "default:dry_grass_1"},
  189. {"bamboo_dirt", "ethereal", "ethereal:bamboo_leaves"},
  190. {"cold_dirt", "ethereal", "default:ice"},
  191. {"prairie_dirt", "ethereal", "group:flower"},
  192. {"mushroom_dirt", "ethereal", "flowers:mushroom_red"},
  193. {"jungle_dirt", "ethereal", "default:jungleleaves"},
  194. {"crystal_dirt", "ethereal", "ethereal:crystalgrass"},
  195. {"fiery_dirt", "ethereal", "ethereal:dry_shrub"},
  196. {"gray_dirt", "ethereal", "ethereal:snowygrass"},
  197. {"grove_dirt", "ethereal", "ethereal:fern"}
  198. }
  199. function is_mod_enabled(mod_name)
  200. if mod_name == "default" then
  201. return true
  202. elseif mod_name == "moreblocks" and meseconductors.use_moreblocks then
  203. return true
  204. elseif mod_name == "building_blocks" and meseconductors.use_building_blocks then
  205. return true
  206. elseif mod_name == "glooptest" and meseconductors.use_glooptest then
  207. return true
  208. elseif mod_name == "gloopblocks" and meseconductors.use_gloopblocks then
  209. return true
  210. elseif mod_name == "quartz" and meseconductors.use_quartz then
  211. return true
  212. elseif mod_name == "moretrees" and meseconductors.use_moretrees then
  213. return true
  214. elseif mod_name == "technic" and meseconductors.use_technic then
  215. return true
  216. elseif mod_name == "ethereal" and meseconductors.use_ethereal then
  217. return true
  218. elseif mod_name == "moreores" and meseconductors.use_moreores then
  219. return true
  220. elseif mod_name == "castle" and meseconductors.use_castle then
  221. return true
  222. else
  223. return false
  224. end
  225. end
  226. for i in ipairs(node_list) do
  227. local node = node_list[i]
  228. local node_name = node[1]
  229. local node_mod = node[2]
  230. local node_type = node[3]
  231. if (node_type == "wood") and minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  232. minetest.register_craft({
  233. output = "meseconductors:".. node_mod .. "_" .. node_name,
  234. recipe = {
  235. { "", "mesecons:mesecon", ""},
  236. { "mesecons:mesecon", node_mod .. ":" .. node_name, "mesecons:mesecon"},
  237. { "", "mesecons:mesecon", ""}
  238. }
  239. })
  240. elseif (node_type == "soft") and minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  241. minetest.register_craft({
  242. output = "meseconductors:".. node_mod .. "_" .. node_name,
  243. recipe = {
  244. { "", "default:mese_crystal_fragment", ""},
  245. { "default:mese_crystal_fragment", node_mod .. ":" .. node_name, "default:mese_crystal_fragment"},
  246. { "", "default:mese_crystal_fragment", ""}
  247. }
  248. })
  249. elseif (node_type == "glass") and minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  250. if minetest.get_modpath("technic") then
  251. technic.register_alloy_recipe({
  252. input = {node_mod .. ":" .. node_name, "default:mese_crystal_fragment 4"},
  253. output = "meseconductors:".. node_mod .. "_" .. node_name,
  254. time = 3
  255. })
  256. else
  257. minetest.register_craft({
  258. output = "meseconductors:".. node_mod .. "_" .. node_name,
  259. recipe = {
  260. { "", "default:mese_crystal_fragment", ""},
  261. { "default:mese_crystal_fragment", node_mod .. ":" .. node_name, "default:mese_crystal_fragment"},
  262. { "", "default:mese_crystal_fragment", ""}
  263. }
  264. })
  265. end
  266. elseif (node_type == "stone") and minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  267. if minetest.get_modpath("technic") then
  268. technic.register_alloy_recipe({
  269. input = {node_mod .. ":" .. node_name, "default:mese_crystal"},
  270. output = "meseconductors:".. node_mod .. "_" .. node_name,
  271. time = 4
  272. })
  273. else
  274. minetest.register_craft({
  275. output = "meseconductors:".. node_mod .. "_" .. node_name,
  276. recipe = {
  277. { "default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  278. { "default:mese_crystal_fragment", node_mod .. ":" .. node_name, "default:mese_crystal_fragment"},
  279. { "default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}
  280. }
  281. })
  282. end
  283. elseif (node_type == "block") and minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  284. if minetest.get_modpath("technic") then
  285. technic.register_alloy_recipe({
  286. input = {node_mod .. ":" .. node_name, "default:mese_crystal 2"},
  287. output = "meseconductors:".. node_mod .. "_" .. node_name,
  288. time = 6
  289. })
  290. else
  291. minetest.register_craft({
  292. output = "meseconductors:".. node_mod .. "_" .. node_name,
  293. recipe = {
  294. { "", "", ""},
  295. { "default:mese_crystal", node_mod .. ":" .. node_name, "default:mese_crystal"},
  296. { "", "", ""}
  297. }
  298. })
  299. end
  300. end
  301. end
  302. for i in ipairs(node_list2) do
  303. local node = node_list2[i]
  304. local node_name = node[1]
  305. local node_mod = node[2]
  306. local second_element = node[3]
  307. if minetest.get_modpath(node_mod) and is_mod_enabled(node_mod) then
  308. minetest.register_craft({
  309. output = "meseconductors:".. node_mod .. "_" .. node_name,
  310. recipe = {
  311. { second_element, "default:mese_crystal_fragment", ""},
  312. { "default:mese_crystal_fragment", "default:dirt", "default:mese_crystal_fragment"},
  313. { "", "default:mese_crystal_fragment", ""}
  314. }
  315. })
  316. if minetest.get_modpath("ethereal") then
  317. minetest.register_craft({
  318. output = "meseconductors:".. node_mod .. "_" .. node_name,
  319. recipe = {
  320. { "", "default:mese_crystal_fragment", ""},
  321. { "default:mese_crystal_fragment", node_mod .. ":" .. node_name, "default:mese_crystal_fragment"},
  322. { "", "default:mese_crystal_fragment", ""}
  323. }
  324. })
  325. end
  326. end
  327. end