crafting.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. -- mods/default/crafting.lua
  2. minetest.register_craft({
  3. output = 'default:wood 4',
  4. recipe = {
  5. {'default:tree'},
  6. }
  7. })
  8. minetest.register_craft({
  9. output = 'default:junglewood 4',
  10. recipe = {
  11. {'default:jungletree'},
  12. }
  13. })
  14. minetest.register_craft({
  15. output = 'default:stick 4',
  16. recipe = {
  17. {'group:wood'},
  18. }
  19. })
  20. minetest.register_craft({
  21. output = 'default:fence_wood 6',
  22. recipe = {
  23. {'default:wood', 'default:wood', 'default:wood'},
  24. {'default:wood', 'default:wood', 'default:wood'},
  25. }
  26. })
  27. minetest.register_craft({
  28. output = 'default:sign_wall',
  29. recipe = {
  30. {'group:wood', 'group:wood', 'group:wood'},
  31. {'group:wood', 'group:wood', 'group:wood'},
  32. {'', 'group:stick', ''},
  33. }
  34. })
  35. minetest.register_craft({
  36. output = 'default:torch 4',
  37. recipe = {
  38. {'default:coal_lump'},
  39. {'group:stick'},
  40. }
  41. })
  42. local materials = {
  43. {"wood", "group:wood"},
  44. {"stone", "group:stone", "default:stone"},
  45. {"steel", "default:steel_ingot"},
  46. {"bronze", "default:bronze_ingot"},
  47. }
  48. for i in ipairs(materials) do
  49. local name = materials[i][1]
  50. local craft = materials[i][2]
  51. local subcraft = materials[i][3] or craft
  52. minetest.register_craft({
  53. output = 'default:pick_'..name,
  54. recipe = {
  55. {craft, craft, craft},
  56. {'', 'group:stick', ''},
  57. {'', 'group:stick', ''},
  58. }
  59. })
  60. minetest.register_craft({
  61. type = "cooking",
  62. cooktime = 30,
  63. output = craft,
  64. recipe = "default:pick_"..name,
  65. })
  66. minetest.register_craft({
  67. output = 'default:shovel_'..name,
  68. recipe = {
  69. {craft},
  70. {'group:stick'},
  71. {'group:stick'},
  72. }
  73. })
  74. minetest.register_craft({
  75. output = 'default:axe_'..name,
  76. recipe = {
  77. {craft, craft},
  78. {craft, 'group:stick'},
  79. {'', 'group:stick'},
  80. }
  81. })
  82. minetest.register_craft({
  83. type = "cooking",
  84. cooktime = 30,
  85. output = craft,
  86. recipe = "default:axe_"..name,
  87. })
  88. minetest.register_craft({
  89. output = 'default:sword_'..name,
  90. recipe = {
  91. {craft},
  92. {craft},
  93. {'group:stick'},
  94. }
  95. })
  96. minetest.register_craft({
  97. type = "cooking",
  98. cooktime = 30,
  99. output = craft,
  100. recipe = "default:sword_"..name,
  101. })
  102. end
  103. minetest.register_craft({
  104. output = 'default:rail 15',
  105. recipe = {
  106. {'default:steel_ingot', '', 'default:steel_ingot'},
  107. {'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
  108. {'default:steel_ingot', '', 'default:steel_ingot'},
  109. }
  110. })
  111. minetest.register_craft({
  112. output = 'default:chest',
  113. recipe = {
  114. {'group:wood', 'group:wood', 'group:wood'},
  115. {'group:wood', '', 'group:wood'},
  116. {'group:wood', 'group:wood', 'group:wood'},
  117. }
  118. })
  119. minetest.register_craft({
  120. output = 'default:chest_locked',
  121. recipe = {
  122. {'group:wood', 'group:wood', 'group:wood'},
  123. {'group:wood', 'default:steel_ingot', 'group:wood'},
  124. {'group:wood', 'group:wood', 'group:wood'},
  125. }
  126. })
  127. minetest.register_craft({
  128. output = 'default:furnace',
  129. recipe = {
  130. {'group:stone', 'group:stone', 'group:stone'},
  131. {'group:stone', '', 'group:stone'},
  132. {'group:stone', 'group:stone', 'group:stone'},
  133. }
  134. })
  135. minetest.register_craft({
  136. output = 'default:coalblock',
  137. recipe = {
  138. {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
  139. {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
  140. {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
  141. }
  142. })
  143. minetest.register_craft({
  144. output = 'default:coal_lump 9',
  145. recipe = {
  146. {'default:coalblock'},
  147. }
  148. })
  149. minetest.register_craft({
  150. output = 'default:steelblock',
  151. recipe = {
  152. {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
  153. {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
  154. {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
  155. }
  156. })
  157. minetest.register_craft({
  158. output = 'default:steel_ingot 9',
  159. recipe = {
  160. {'default:steelblock'},
  161. }
  162. })
  163. minetest.register_craft({
  164. output = 'default:copperblock',
  165. recipe = {
  166. {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
  167. {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
  168. {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
  169. }
  170. })
  171. minetest.register_craft({
  172. output = 'default:copper_ingot 9',
  173. recipe = {
  174. {'default:copperblock'},
  175. }
  176. })
  177. minetest.register_craft({
  178. output = 'default:bronzeblock',
  179. recipe = {
  180. {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
  181. {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
  182. {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
  183. }
  184. })
  185. minetest.register_craft({
  186. output = 'default:bronze_ingot 9',
  187. recipe = {
  188. {'default:bronzeblock'},
  189. }
  190. })
  191. minetest.register_craft({
  192. output = 'default:goldblock',
  193. recipe = {
  194. {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
  195. {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
  196. {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
  197. }
  198. })
  199. minetest.register_craft({
  200. output = 'default:gold_ingot 9',
  201. recipe = {
  202. {'default:goldblock'},
  203. }
  204. })
  205. minetest.register_craft({
  206. output = 'default:stone_block 9',
  207. recipe = {
  208. {'default:stone', 'default:stone', 'default:stone'},
  209. {'default:stone', 'default:stone', 'default:stone'},
  210. {'default:stone', 'default:stone', 'default:stone'},
  211. }
  212. })
  213. minetest.register_craft({
  214. output = 'default:desert_stone_block 9',
  215. recipe = {
  216. {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
  217. {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
  218. {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
  219. }
  220. })
  221. minetest.register_craft({
  222. output = 'default:sandstone 2',
  223. recipe = {
  224. {'default:sand', 'default:sand'},
  225. {'default:sand', 'default:sand'},
  226. }
  227. })
  228. minetest.register_craft({
  229. output = 'default:sand 2',
  230. recipe = {
  231. {'default:sandstone'},
  232. }
  233. })
  234. minetest.register_craft({
  235. output = 'default:sand',
  236. recipe = {
  237. {'default:gravel'},
  238. }
  239. })
  240. minetest.register_craft({
  241. output = 'default:sandstonebrick 4',
  242. recipe = {
  243. {'default:sandstone', 'default:sandstone'},
  244. {'default:sandstone', 'default:sandstone'},
  245. }
  246. })
  247. minetest.register_craft({
  248. output = 'default:sandstone_block 9',
  249. recipe = {
  250. {'default:sandstone', 'default:sandstone', 'default:sandstone'},
  251. {'default:sandstone', 'default:sandstone', 'default:sandstone'},
  252. {'default:sandstone', 'default:sandstone', 'default:sandstone'},
  253. }
  254. })
  255. minetest.register_craft({
  256. output = 'default:desert_sandstone 2',
  257. recipe = {
  258. {'default:desert_sand', 'default:desert_sand'},
  259. {'default:desert_sand', 'default:desert_sand'},
  260. }
  261. })
  262. minetest.register_craft({
  263. output = 'default:desert_sand 2',
  264. recipe = {
  265. {'default:desert_sandstone'},
  266. }
  267. })
  268. minetest.register_craft({
  269. output = 'default:desert_sandstonebrick 4',
  270. recipe = {
  271. {'default:desert_sandstone', 'default:desert_sandstone'},
  272. {'default:desert_sandstone', 'default:desert_sandstone'},
  273. }
  274. })
  275. minetest.register_craft({
  276. output = 'default:desert_sandstone_block 9',
  277. recipe = {
  278. {'default:desert_sandstone', 'default:desert_sandstone', 'default:desert_sandstone'},
  279. {'default:desert_sandstone', 'default:desert_sandstone', 'default:desert_sandstone'},
  280. {'default:desert_sandstone', 'default:desert_sandstone', 'default:desert_sandstone'},
  281. }
  282. })
  283. minetest.register_craft({
  284. output = 'default:silver_sandstone 2',
  285. recipe = {
  286. {'default:silver_sand', 'default:silver_sand'},
  287. {'default:silver_sand', 'default:silver_sand'},
  288. }
  289. })
  290. minetest.register_craft({
  291. output = 'default:silver_sand 2',
  292. recipe = {
  293. {'default:silver_sandstone'},
  294. }
  295. })
  296. minetest.register_craft({
  297. output = 'default:silver_sandstonebrick 4',
  298. recipe = {
  299. {'default:silver_sandstone', 'default:silver_sandstone'},
  300. {'default:silver_sandstone', 'default:silver_sandstone'},
  301. }
  302. })
  303. minetest.register_craft({
  304. output = 'default:silver_sandstone_block 9',
  305. recipe = {
  306. {'default:silver_sandstone', 'default:silver_sandstone', 'default:silver_sandstone'},
  307. {'default:silver_sandstone', 'default:silver_sandstone', 'default:silver_sandstone'},
  308. {'default:silver_sandstone', 'default:silver_sandstone', 'default:silver_sandstone'},
  309. }
  310. })
  311. minetest.register_craft({
  312. output = 'default:clay',
  313. recipe = {
  314. {'default:clay_lump', 'default:clay_lump'},
  315. {'default:clay_lump', 'default:clay_lump'},
  316. }
  317. })
  318. minetest.register_craft({
  319. output = 'default:brick',
  320. recipe = {
  321. {'default:clay_brick', 'default:clay_brick'},
  322. {'default:clay_brick', 'default:clay_brick'},
  323. }
  324. })
  325. minetest.register_craft({
  326. output = 'default:clay_brick 4',
  327. recipe = {
  328. {'default:brick'},
  329. }
  330. })
  331. minetest.register_craft({
  332. output = 'default:paper',
  333. recipe = {
  334. {'default:papyrus', 'default:papyrus', 'default:papyrus'},
  335. }
  336. })
  337. minetest.register_craft({
  338. output = 'default:book',
  339. recipe = {
  340. {'default:paper'},
  341. {'default:paper'},
  342. {'default:paper'},
  343. }
  344. })
  345. minetest.register_craft({
  346. output = 'default:bookshelf',
  347. recipe = {
  348. {'group:wood', 'group:wood', 'group:wood'},
  349. {'default:book', 'default:book', 'default:book'},
  350. {'group:wood', 'group:wood', 'group:wood'},
  351. }
  352. })
  353. minetest.register_craft({
  354. output = 'default:ladder 7',
  355. recipe = {
  356. {'group:stick', '', 'group:stick'},
  357. {'group:stick', 'group:stick', 'group:stick'},
  358. {'group:stick', '', 'group:stick'},
  359. }
  360. })
  361. minetest.register_craft({
  362. output = 'default:mese',
  363. recipe = {
  364. {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
  365. {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
  366. {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
  367. }
  368. })
  369. minetest.register_craft({
  370. output = 'default:mese_crystal 9',
  371. recipe = {
  372. {'default:mese'},
  373. }
  374. })
  375. minetest.register_craft({
  376. output = 'default:mese_crystal_fragment 9',
  377. recipe = {
  378. {'default:mese_crystal'},
  379. }
  380. })
  381. minetest.register_craft({
  382. output = 'default:mese_crystal',
  383. recipe = {
  384. {'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
  385. {'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
  386. {'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
  387. }
  388. })
  389. minetest.register_craft({
  390. output = 'default:obsidian_shard 9',
  391. recipe = {
  392. {'default:obsidian'}
  393. }
  394. })
  395. minetest.register_craft({
  396. output = 'default:obsidian',
  397. recipe = {
  398. {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
  399. {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
  400. {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
  401. }
  402. })
  403. minetest.register_craft({
  404. output = 'default:stonebrick 4',
  405. recipe = {
  406. {'default:stone', 'default:stone'},
  407. {'default:stone', 'default:stone'},
  408. }
  409. })
  410. minetest.register_craft({
  411. output = 'default:desert_stonebrick 4',
  412. recipe = {
  413. {'default:desert_stone', 'default:desert_stone'},
  414. {'default:desert_stone', 'default:desert_stone'},
  415. }
  416. })
  417. minetest.register_craft({
  418. output = 'default:snowblock',
  419. recipe = {
  420. {'default:snow', 'default:snow', 'default:snow'},
  421. {'default:snow', 'default:snow', 'default:snow'},
  422. {'default:snow', 'default:snow', 'default:snow'},
  423. }
  424. })
  425. minetest.register_craft({
  426. output = 'default:snow 9',
  427. recipe = {
  428. {'default:snowblock'},
  429. }
  430. })
  431. minetest.register_craft({
  432. output = "default:gravel",
  433. recipe = {
  434. {'default:cobble'},
  435. }
  436. })
  437. --
  438. -- Crafting (tool repair)
  439. --
  440. minetest.register_craft({
  441. type = "toolrepair",
  442. additional_wear = -0.02,
  443. })
  444. --
  445. -- Cooking recipes
  446. --
  447. minetest.register_craft({
  448. type = "cooking",
  449. output = "default:glass",
  450. recipe = "group:sand",
  451. })
  452. minetest.register_craft({
  453. type = "cooking",
  454. output = "default:obsidian_glass",
  455. recipe = "default:obsidian_shard",
  456. })
  457. minetest.register_craft({
  458. type = "cooking",
  459. output = "default:stone",
  460. recipe = "default:cobble",
  461. })
  462. minetest.register_craft({
  463. type = "cooking",
  464. output = "default:desert_stone",
  465. recipe = "default:desert_cobble",
  466. })
  467. minetest.register_craft({
  468. type = "cooking",
  469. output = "default:steel_ingot",
  470. recipe = "default:iron_lump",
  471. })
  472. minetest.register_craft({
  473. type = "cooking",
  474. output = "default:copper_ingot",
  475. recipe = "default:copper_lump",
  476. })
  477. minetest.register_craft({
  478. type = "cooking",
  479. output = "default:gold_ingot",
  480. recipe = "default:gold_lump",
  481. })
  482. minetest.register_craft({
  483. type = "cooking",
  484. output = "default:clay_brick",
  485. recipe = "default:clay_lump",
  486. })
  487. minetest.register_craft({
  488. type = "cooking",
  489. output = "default:cobble",
  490. recipe = "default:gravel",
  491. })
  492. --
  493. -- Fuels
  494. --
  495. minetest.register_craft({
  496. type = "fuel",
  497. recipe = "group:tree",
  498. burntime = 30,
  499. })
  500. minetest.register_craft({
  501. type = "fuel",
  502. recipe = "default:junglegrass",
  503. burntime = 2,
  504. })
  505. minetest.register_craft({
  506. type = "fuel",
  507. recipe = "group:leaves",
  508. burntime = 1,
  509. })
  510. minetest.register_craft({
  511. type = "fuel",
  512. recipe = "default:cactus",
  513. burntime = 15,
  514. })
  515. minetest.register_craft({
  516. type = "fuel",
  517. recipe = "default:papyrus",
  518. burntime = 1,
  519. })
  520. minetest.register_craft({
  521. type = "fuel",
  522. recipe = "default:bookshelf",
  523. burntime = 30,
  524. })
  525. minetest.register_craft({
  526. type = "fuel",
  527. recipe = "default:fence_wood",
  528. burntime = 15,
  529. })
  530. minetest.register_craft({
  531. type = "fuel",
  532. recipe = "default:ladder",
  533. burntime = 5,
  534. })
  535. minetest.register_craft({
  536. type = "fuel",
  537. recipe = "group:wood",
  538. burntime = 7,
  539. })
  540. minetest.register_craft({
  541. type = "fuel",
  542. recipe = "default:lava_source",
  543. burntime = 60,
  544. })
  545. minetest.register_craft({
  546. type = "fuel",
  547. recipe = "default:torch",
  548. burntime = 4,
  549. })
  550. minetest.register_craft({
  551. type = "fuel",
  552. recipe = "default:sign_wall",
  553. burntime = 10,
  554. })
  555. minetest.register_craft({
  556. type = "fuel",
  557. recipe = "default:chest",
  558. burntime = 30,
  559. })
  560. minetest.register_craft({
  561. type = "fuel",
  562. recipe = "default:chest_locked",
  563. burntime = 30,
  564. })
  565. minetest.register_craft({
  566. type = "fuel",
  567. recipe = "default:sapling",
  568. burntime = 10,
  569. })
  570. minetest.register_craft({
  571. type = "fuel",
  572. recipe = "default:apple",
  573. burntime = 3,
  574. })
  575. minetest.register_craft({
  576. type = "fuel",
  577. recipe = "default:coal_lump",
  578. burntime = 40,
  579. })
  580. minetest.register_craft({
  581. type = "fuel",
  582. recipe = "default:coalblock",
  583. burntime = 370,
  584. })
  585. minetest.register_craft({
  586. type = "fuel",
  587. recipe = "default:junglesapling",
  588. burntime = 10,
  589. })
  590. minetest.register_craft({
  591. type = "fuel",
  592. recipe = "default:grass_1",
  593. burntime = 2,
  594. })