recipes.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. --[[
  2. More Blocks: Stairs+
  3. Copyright © 2011-2019 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. stairsplus.register_recipes = function(category, alternate, modname, subname, recipeitem)
  7. if category == "micro" and alternate == "" then
  8. minetest.register_craft({
  9. type = "shapeless",
  10. output = modname .. ":micro_" .. subname .. " 7",
  11. recipe = {modname .. ":stair_" .. subname .. "_inner"},
  12. })
  13. minetest.register_craft({
  14. type = "shapeless",
  15. output = modname .. ":micro_" .. subname .. " 6",
  16. recipe = {modname .. ":stair_" .. subname},
  17. })
  18. minetest.register_craft({
  19. type = "shapeless",
  20. output = modname .. ":micro_" .. subname .. " 5",
  21. recipe = {modname .. ":stair_" .. subname .. "_outer"},
  22. })
  23. minetest.register_craft({
  24. type = "shapeless",
  25. output = modname .. ":micro_" .. subname .. " 4",
  26. recipe = {modname .. ":slab_" .. subname},
  27. })
  28. minetest.register_craft({
  29. type = "shapeless",
  30. output = modname .. ":micro_" .. subname .. " 4",
  31. recipe = {modname .. ":stair_" .. subname .. "_alt"},
  32. })
  33. minetest.register_craft({
  34. type = "shapeless",
  35. output = modname .. ":micro_" .. subname .. " 3",
  36. recipe = {modname .. ":stair_" .. subname .. "_right_half"},
  37. })
  38. minetest.register_craft({
  39. type = "shapeless",
  40. output = modname .. ":micro_" .. subname .. " 2",
  41. recipe = {modname .. ":panel_" .. subname},
  42. })
  43. minetest.register_craft({
  44. type = "shapeless",
  45. output = recipeitem,
  46. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  47. })
  48. minetest.register_alias(modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname)
  49. elseif category == "panel" and alternate == "" then
  50. minetest.register_craft({
  51. output = modname .. ":panel_" .. subname .. " 12",
  52. recipe = {
  53. {recipeitem, ""},
  54. {recipeitem, recipeitem},
  55. },
  56. })
  57. minetest.register_craft({
  58. output = modname .. ":panel_" .. subname .. " 12",
  59. recipe = {
  60. {"", recipeitem},
  61. {recipeitem, recipeitem},
  62. },
  63. })
  64. minetest.register_craft({
  65. type = "shapeless",
  66. output = modname .. ":panel_" .. subname,
  67. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  68. })
  69. minetest.register_craft({
  70. type = "shapeless",
  71. output = recipeitem,
  72. recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
  73. })
  74. minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
  75. elseif category == "slab" then
  76. if alternate == "" then
  77. minetest.register_craft({
  78. output = modname .. ":slab_" .. subname .. " 6",
  79. recipe = {{recipeitem, recipeitem, recipeitem}},
  80. })
  81. minetest.register_craft({
  82. type = "shapeless",
  83. output = modname .. ":slab_" .. subname,
  84. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  85. })
  86. -- uncomment this rule when conflict is no longer likely to happen
  87. -- https://github.com/minetest/minetest/issues/2881
  88. -- minetest.register_craft({
  89. -- type = "shapeless",
  90. -- output = modname .. ":slab_" .. subname,
  91. -- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
  92. -- })
  93. -- then remove these two
  94. minetest.register_craft({
  95. output = modname .. ":slab_" .. subname,
  96. recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}},
  97. })
  98. minetest.register_craft({
  99. output = modname .. ":slab_" .. subname,
  100. recipe = {
  101. {modname .. ":panel_" .. subname},
  102. {modname .. ":panel_" .. subname},
  103. },
  104. })
  105. ------------------------------
  106. minetest.register_craft({
  107. type = "shapeless",
  108. output = recipeitem,
  109. recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname},
  110. })
  111. minetest.register_craft({
  112. type = "shapeless",
  113. output = modname .. ":slab_" .. subname .. " 3",
  114. recipe = {modname .. ":stair_" .. subname, modname .. ":stair_" .. subname},
  115. })
  116. minetest.register_craft({
  117. type = "shapeless",
  118. output = modname .. ":slab_" .. subname,
  119. recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
  120. })
  121. minetest.register_craft({
  122. type = "shapeless",
  123. output = modname .. ":slab_" .. subname,
  124. recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
  125. })
  126. minetest.register_craft({
  127. type = "shapeless",
  128. output = modname .. ":slab_" .. subname,
  129. recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
  130. })
  131. minetest.register_craft({
  132. type = "shapeless",
  133. output = modname .. ":slab_" .. subname,
  134. recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
  135. })
  136. minetest.register_craft({
  137. type = "shapeless",
  138. output = modname .. ":slab_" .. subname,
  139. recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half"},
  140. })
  141. minetest.register_craft({
  142. type = "shapeless",
  143. output = modname .. ":slab_" .. subname,
  144. recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half"},
  145. })
  146. elseif alternate == "_quarter" then
  147. minetest.register_craft({
  148. type = "shapeless",
  149. output = recipeitem,
  150. recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
  151. })
  152. minetest.register_craft({
  153. type = "shapeless",
  154. output = recipeitem,
  155. recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_quarter"},
  156. })
  157. minetest.register_craft({
  158. type = "shapeless",
  159. output = modname .. ":slab_" .. subname .. "_quarter",
  160. recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
  161. })
  162. minetest.register_craft({
  163. type = "shapeless",
  164. output = modname .. ":slab_" .. subname .. "_quarter",
  165. recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
  166. })
  167. elseif alternate == "_three_quarter" then
  168. minetest.register_craft({
  169. type = "shapeless",
  170. output = modname .. ":slab_" .. subname .. "_three_quarter",
  171. recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname .. "_quarter"},
  172. })
  173. minetest.register_craft({
  174. type = "shapeless",
  175. output = modname .. ":slab_" .. subname .. "_three_quarter",
  176. recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
  177. })
  178. minetest.register_craft({
  179. type = "shapeless",
  180. output = modname .. ":slab_" .. subname .. "_three_quarter",
  181. recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
  182. })
  183. elseif alternate == "_2" then
  184. minetest.register_craft({
  185. type = "shapeless",
  186. output = recipeitem,
  187. recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
  188. })
  189. minetest.register_craft({
  190. type = "shapeless",
  191. output = recipeitem,
  192. recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_2"},
  193. })
  194. minetest.register_craft({
  195. type = "shapeless",
  196. output = modname .. ":slab_" .. subname .. "_2",
  197. recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
  198. })
  199. elseif alternate == "_14" then
  200. minetest.register_craft({
  201. type = "shapeless",
  202. output = modname .. ":slab_" .. subname .. "_14",
  203. recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_2"},
  204. })
  205. minetest.register_craft({
  206. type = "shapeless",
  207. output = modname .. ":slab_" .. subname .. "_14",
  208. recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
  209. })
  210. elseif alternate == "_15" then
  211. minetest.register_craft({
  212. type = "shapeless",
  213. output = recipeitem,
  214. recipe = {modname .. ":slab_" .. subname .. "_15", modname .. ":slab_" .. subname .. "_1"},
  215. })
  216. minetest.register_craft({
  217. type = "shapeless",
  218. output = modname .. ":slab_" .. subname .. "_15",
  219. recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_1"},
  220. })
  221. end
  222. elseif category == "slope" then
  223. if alternate == "" then
  224. minetest.register_craft({
  225. type = "shapeless",
  226. output = recipeitem,
  227. recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
  228. })
  229. elseif alternate == "_half" then
  230. minetest.register_craft({
  231. type = "shapeless",
  232. output = recipeitem,
  233. recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
  234. })
  235. minetest.register_craft({
  236. type = "shapeless",
  237. output = recipeitem,
  238. recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
  239. modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
  240. })
  241. elseif alternate == "_outer" then
  242. minetest.register_craft({
  243. type = "shapeless",
  244. output = recipeitem,
  245. recipe = {modname .. ":slope_" .. subname .. "_outer", modname .. ":slope_" .. subname .. "_inner"},
  246. })
  247. elseif alternate == "_outer_half" then
  248. minetest.register_craft({
  249. type = "shapeless",
  250. output = recipeitem,
  251. recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half_raised"},
  252. })
  253. elseif alternate == "_inner_half" then
  254. minetest.register_craft({
  255. type = "shapeless",
  256. output = recipeitem,
  257. recipe = {modname .. ":slope_" .. subname .. "_outer_half_raised", modname .. ":slope_" .. subname .. "_inner_half"},
  258. })
  259. elseif alternate == "_outer_cut" then
  260. minetest.register_craft({
  261. type = "shapeless",
  262. output = recipeitem,
  263. recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_inner_cut"},
  264. })
  265. elseif alternate == "_outer_cut_half" then
  266. minetest.register_craft({
  267. type = "shapeless",
  268. output = recipeitem,
  269. recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half_raised"},
  270. })
  271. elseif alternate == "_cut" then
  272. minetest.register_craft({
  273. type = "shapeless",
  274. output = recipeitem,
  275. recipe = {modname .. ":slope_" .. subname .. "_cut", modname .. ":slope_" .. subname .. "_cut"},
  276. })
  277. elseif alternate == "_half_raised" then
  278. minetest.register_craft({
  279. type = "shapeless",
  280. output = modname .. ":slope_" .. subname .. "_half_raised",
  281. recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
  282. modname .. ":slope_" .. subname .. "_half"},
  283. })
  284. minetest.register_craft({
  285. type = "shapeless",
  286. output = modname .. ":slope_" .. subname .. "_half_raised",
  287. recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"},
  288. })
  289. elseif alternate == "_inner_half_raised" then
  290. minetest.register_craft({
  291. type = "shapeless",
  292. output = modname .. ":slope_" .. subname .. "_inner_half_raised",
  293. recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"},
  294. })
  295. elseif alternate == "_outer_half_raised" then
  296. minetest.register_craft({
  297. type = "shapeless",
  298. output = modname .. ":slope_" .. subname .. "_outer_half_raised",
  299. recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"},
  300. })
  301. elseif alternate == "_inner_cut_half_raised" then
  302. minetest.register_craft({
  303. type = "shapeless",
  304. output = modname .. ":slope_" .. subname .. "_inner_cut_half_raised",
  305. recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_cut_half"},
  306. })
  307. end
  308. elseif category == "stair" then
  309. if alternate == "" then
  310. minetest.register_craft({
  311. output = modname .. ":stair_" .. subname .. " 8",
  312. recipe = {
  313. {recipeitem, "", ""},
  314. {recipeitem, recipeitem, ""},
  315. {recipeitem, recipeitem, recipeitem},
  316. },
  317. })
  318. minetest.register_craft({
  319. output = modname .. ":stair_" .. subname .. " 8",
  320. recipe = {
  321. {"", "", recipeitem},
  322. {"", recipeitem, recipeitem},
  323. {recipeitem, recipeitem, recipeitem},
  324. },
  325. })
  326. minetest.register_craft({
  327. type = "shapeless",
  328. output = modname .. ":stair_" .. subname,
  329. recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
  330. })
  331. minetest.register_craft({
  332. type = "shapeless",
  333. output = modname .. ":stair_" .. subname,
  334. recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
  335. })
  336. minetest.register_craft({
  337. type = "shapeless",
  338. output = modname .. ":stair_" .. subname,
  339. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  340. })
  341. minetest.register_craft({
  342. type = "shapeless",
  343. output = modname .. ":stair_" .. subname,
  344. recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
  345. })
  346. elseif alternate == "_inner" then
  347. minetest.register_craft({
  348. type = "shapeless",
  349. output = modname .. ":stair_" .. subname .. "_inner",
  350. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  351. })
  352. elseif alternate == "_outer" then
  353. minetest.register_craft({
  354. type = "shapeless",
  355. output = modname .. ":stair_" .. subname .. "_outer",
  356. recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
  357. })
  358. minetest.register_craft({
  359. type = "shapeless",
  360. output = modname .. ":stair_" .. subname .. "_outer",
  361. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  362. })
  363. elseif alternate == "_half" then
  364. minetest.register_craft({
  365. type = "shapeless",
  366. output = modname .. ":stair_" .. subname .. "_half",
  367. recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
  368. })
  369. minetest.register_craft({
  370. type = "shapeless",
  371. output = modname .. ":stair_" .. subname .. "_half",
  372. recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
  373. })
  374. elseif alternate == "_right_half" then
  375. minetest.register_craft({
  376. type = "shapeless",
  377. output = modname .. ":stair_" .. subname .. "_right_half",
  378. recipe = {modname .. ":stair_" .. subname .. "_half"},
  379. })
  380. elseif alternate == "_alt" then
  381. minetest.register_craft({ -- See mirrored variation of the recipe below.
  382. output = modname .. ":stair_" .. subname .. "_alt",
  383. recipe = {
  384. {modname .. ":panel_" .. subname, ""},
  385. {"" , modname .. ":panel_" .. subname},
  386. },
  387. })
  388. minetest.register_craft({ -- Mirrored variation of the recipe above.
  389. output = modname .. ":stair_" .. subname .. "_alt",
  390. recipe = {
  391. {"" , modname .. ":panel_" .. subname},
  392. {modname .. ":panel_" .. subname, ""},
  393. },
  394. })
  395. end
  396. end
  397. end