food.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. local S = farming.intllib
  2. --= Sugar
  3. minetest.register_craftitem("farming:sugar", {
  4. description = S("Sugar"),
  5. inventory_image = "farming_sugar.png",
  6. groups = {food_sugar = 1, flammable = 3}
  7. })
  8. minetest.register_craft({
  9. type = "cooking",
  10. cooktime = 3,
  11. output = "farming:sugar 2",
  12. recipe = "default:papyrus"
  13. })
  14. --= Sugar caramel
  15. minetest.register_craftitem("farming:caramel", {
  16. description = S("Caramel"),
  17. inventory_image = "farming_caramel.png",
  18. })
  19. minetest.register_craft({
  20. type = "cooking",
  21. cooktime = 6,
  22. output = "farming:caramel",
  23. recipe = "group:food_sugar",
  24. })
  25. --= Salt
  26. minetest.register_node("farming:salt", {
  27. description = S("Salt"),
  28. inventory_image = "farming_salt.png",
  29. wield_image = "farming_salt.png",
  30. drawtype = "plantlike",
  31. visual_scale = 0.8,
  32. paramtype = "light",
  33. tiles = {"farming_salt.png"},
  34. groups = {food_salt = 1, vessel = 1, dig_immediate = 3,
  35. attached_node = 1},
  36. sounds = default.node_sound_defaults(),
  37. selection_box = {
  38. type = "fixed",
  39. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  40. },
  41. -- special function to make salt crystals form inside water
  42. dropped_step = function(self, pos, dtime)
  43. self.ctimer = (self.ctimer or 0) + dtime
  44. if self.ctimer < 15.0 then return end
  45. self.ctimer = 0
  46. local needed
  47. if self.node_inside
  48. and self.node_inside.name == "default:water_source" then
  49. needed = 8
  50. elseif self.node_inside
  51. and self.node_inside.name == "default:river_water_source" then
  52. needed = 9
  53. end
  54. if not needed then return end
  55. local objs = core.get_objects_inside_radius(pos, 0.5)
  56. if not objs or #objs ~= 1 then return end
  57. local salt, ent = nil, nil
  58. for k, obj in pairs(objs) do
  59. ent = obj:get_luaentity()
  60. if ent and ent.name == "__builtin:item"
  61. and ent.itemstring == "farming:salt " .. needed then
  62. obj:remove()
  63. core.add_item(pos, "farming:salt_crystal")
  64. return false -- return with no further action
  65. end
  66. end
  67. end
  68. })
  69. minetest.register_craft({
  70. type = "cooking",
  71. cooktime = 15,
  72. output = "farming:salt",
  73. recipe = "bucket:bucket_water",
  74. replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
  75. })
  76. --= Salt Crystal
  77. minetest.register_node("farming:salt_crystal", {
  78. description = ("Salt crystal"),
  79. inventory_image = "farming_salt_crystal.png",
  80. wield_image = "farming_salt_crystal.png",
  81. drawtype = "plantlike",
  82. visual_scale = 0.8,
  83. paramtype = "light",
  84. light_source = 1,
  85. tiles = {"farming_salt_crystal.png"},
  86. groups = { dig_immediate = 3, attached_node = 1},
  87. sounds = default.node_sound_defaults(),
  88. selection_box = {
  89. type = "fixed",
  90. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  91. },
  92. })
  93. minetest.register_craft({
  94. -- type = "shapeless",
  95. output = "farming:salt 9",
  96. recipe = {
  97. {"farming:salt_crystal", "farming:mortar_pestle"}
  98. },
  99. replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}
  100. })
  101. minetest.register_craft({
  102. output = "farming:salt_crystal",
  103. recipe = {
  104. {"farming:salt", "farming:salt", "farming:salt"},
  105. {"farming:salt", "farming:salt", "farming:salt"},
  106. {"farming:salt", "farming:salt", "farming:salt"}
  107. }
  108. })
  109. --= Rose Water
  110. minetest.register_node("farming:rose_water", {
  111. description = S("Rose Water"),
  112. inventory_image = "farming_rose_water.png",
  113. wield_image = "farming_rose_water.png",
  114. drawtype = "plantlike",
  115. visual_scale = 0.8,
  116. paramtype = "light",
  117. tiles = {"farming_rose_water.png"},
  118. groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3,
  119. attached_node = 1},
  120. sounds = default.node_sound_defaults(),
  121. selection_box = {
  122. type = "fixed",
  123. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  124. }
  125. })
  126. minetest.register_craft({
  127. output = "farming:rose_water",
  128. recipe = {
  129. {"flowers:rose", "flowers:rose", "flowers:rose"},
  130. {"flowers:rose", "flowers:rose", "flowers:rose"},
  131. {"group:water_bucket", "group:food_pot", "vessels:glass_bottle"}
  132. },
  133. replacements = {
  134. {"group:water_bucket", "bucket:bucket_empty"},
  135. {"group:food_pot", "farming:pot"}
  136. }
  137. })
  138. if minetest.get_modpath("bucket_wooden") then
  139. minetest.register_craft({
  140. output = "farming:rose_water",
  141. recipe = {
  142. {"flowers:rose", "flowers:rose", "flowers:rose"},
  143. {"flowers:rose", "flowers:rose", "flowers:rose"},
  144. {"group:water_bucket_wooden", "group:food_pot", "vessels:glass_bottle"}
  145. },
  146. replacements = {
  147. {"group:water_bucket_wooden", "bucket_wooden:bucket_empty"},
  148. {"group:food_pot", "farming:pot"}
  149. }
  150. })
  151. end
  152. --= Turkish Delight
  153. minetest.register_craftitem("farming:turkish_delight", {
  154. description = S("Turkish Delight"),
  155. inventory_image = "farming_turkish_delight.png",
  156. groups = {flammable = 3},
  157. on_use = minetest.item_eat(2)
  158. })
  159. minetest.register_craft({
  160. output = "farming:turkish_delight 4",
  161. recipe = {
  162. {"group:food_gelatin", "group:food_sugar", "group:food_gelatin"},
  163. {"group:food_sugar", "group:food_rose_water", "group:food_sugar"},
  164. {"group:food_sugar", "dye:pink", "group:food_sugar"}
  165. },
  166. replacements = {
  167. {"group:food_cornstarch", "farming:bowl"},
  168. {"group:food_rose_water", "vessels:glass_bottle"}
  169. }
  170. })
  171. --= Garlic Bread
  172. minetest.register_craftitem("farming:garlic_bread", {
  173. description = S("Garlic Bread"),
  174. inventory_image = "farming_garlic_bread.png",
  175. groups = {flammable = 3},
  176. on_use = minetest.item_eat(2)
  177. })
  178. minetest.register_craft({
  179. -- type = "shapeless",
  180. output = "farming:garlic_bread",
  181. recipe = {
  182. {"group:food_toast", "group:food_garlic_clove", "group:food_garlic_clove"}
  183. }
  184. })
  185. --= Donuts (thanks to Bockwurst for making the donut images)
  186. minetest.register_craftitem("farming:donut", {
  187. description = S("Donut"),
  188. inventory_image = "farming_donut.png",
  189. on_use = minetest.item_eat(4)
  190. })
  191. minetest.register_craft({
  192. output = "farming:donut 3",
  193. recipe = {
  194. {"", "group:food_wheat", ""},
  195. {"group:food_wheat", "group:food_sugar", "group:food_wheat"},
  196. {"", "group:food_wheat", ""}
  197. }
  198. })
  199. minetest.register_craftitem("farming:donut_chocolate", {
  200. description = S("Chocolate Donut"),
  201. inventory_image = "farming_donut_chocolate.png",
  202. on_use = minetest.item_eat(6)
  203. })
  204. minetest.register_craft({
  205. output = "farming:donut_chocolate",
  206. recipe = {
  207. {"group:food_cocoa"},
  208. {"farming:donut"}
  209. }
  210. })
  211. minetest.register_craftitem("farming:donut_apple", {
  212. description = S("Apple Donut"),
  213. inventory_image = "farming_donut_apple.png",
  214. on_use = minetest.item_eat(6)
  215. })
  216. minetest.register_craft({
  217. output = "farming:donut_apple",
  218. recipe = {
  219. {"default:apple"},
  220. {"farming:donut"}
  221. }
  222. })
  223. --= Porridge Oats
  224. minetest.register_craftitem("farming:porridge", {
  225. description = S("Porridge"),
  226. inventory_image = "farming_porridge.png",
  227. on_use = minetest.item_eat(6, "farming:bowl")
  228. })
  229. minetest.register_craft({
  230. -- type = "shapeless",
  231. output = "farming:porridge",
  232. recipe = {
  233. {"group:food_oats", "group:food_oats", "group:food_oats"},
  234. {"group:food_oats", "group:food_bowl", "group:food_milk_glass"}
  235. },
  236. replacements = {
  237. {"mobs:glass_milk", "vessels:drinking_glass"},
  238. {"farming:soy_milk", "vessels:drinking_glass"}
  239. }
  240. })
  241. --= Jaffa Cake
  242. minetest.register_craftitem("farming:jaffa_cake", {
  243. description = S("Jaffa Cake"),
  244. inventory_image = "farming_jaffa_cake.png",
  245. on_use = minetest.item_eat(6)
  246. })
  247. minetest.register_craft({
  248. -- type = "shapeless",
  249. output = "farming:jaffa_cake",
  250. recipe = {
  251. {"farming:baking_tray", "group:food_egg", "group:food_sugar"},
  252. {"group:food_flour", "group:food_cocoa", "group:food_orange"},
  253. {"group:food_milk", "", ""}
  254. },
  255. replacements = {
  256. {"farming:baking_tray", "farming:baking_tray"},
  257. {"mobs:bucket_milk", "bucket:bucket_empty"}
  258. }
  259. })
  260. -- Apple Pie
  261. minetest.register_craftitem("farming:apple_pie", {
  262. description = S("Apple Pie"),
  263. inventory_image = "farming_apple_pie.png",
  264. on_use = minetest.item_eat(6)
  265. })
  266. minetest.register_craft({
  267. output = "farming:apple_pie",
  268. recipe = {
  269. {"group:food_flour", "group:food_sugar", "group:food_apple"},
  270. {"", "group:food_baking_tray", ""}
  271. },
  272. replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
  273. })
  274. -- Cactus Juice
  275. minetest.register_craftitem("farming:cactus_juice", {
  276. description = S("Cactus Juice"),
  277. inventory_image = "farming_cactus_juice.png",
  278. groups = {vessel = 1, drink = 1},
  279. on_use = function(itemstack, user, pointed_thing)
  280. if user then
  281. if math.random(5) == 1 then
  282. return minetest.do_item_eat(-1, "vessels:drinking_glass",
  283. itemstack, user, pointed_thing)
  284. else
  285. return minetest.do_item_eat(2, "vessels:drinking_glass",
  286. itemstack, user, pointed_thing)
  287. end
  288. end
  289. end
  290. })
  291. minetest.register_craft({
  292. output = "farming:cactus_juice",
  293. recipe = {
  294. {"default:cactus"},
  295. {"farming:juicer"},
  296. {"vessels:drinking_glass"}
  297. },
  298. replacements = {
  299. {"group:food_juicer", "farming:juicer"}
  300. }
  301. })
  302. -- Pasta
  303. minetest.register_craftitem("farming:pasta", {
  304. description = S("Pasta"),
  305. inventory_image = "farming_pasta.png",
  306. groups = {food_pasta = 1}
  307. })
  308. minetest.register_craft({
  309. output = "farming:pasta",
  310. recipe = {
  311. {"group:food_flour", "group:food_butter", "group:food_mixing_bowl"}
  312. },
  313. replacements = {{"group:food_mixing_bowl", "farming:mixing_bowl"}}
  314. })
  315. minetest.register_craft({
  316. output = "farming:pasta",
  317. recipe = {
  318. {"group:food_flour", "group:food_oil", "group:food_mixing_bowl"}
  319. },
  320. replacements = {
  321. {"group:food_mixing_bowl", "farming:mixing_bowl"},
  322. {"group:food_oil", "vessels:glass_bottle"}
  323. }
  324. })
  325. -- Spaghetti
  326. minetest.register_craftitem("farming:spaghetti", {
  327. description = S("Spaghetti"),
  328. inventory_image = "farming_spaghetti.png",
  329. on_use = minetest.item_eat(8)
  330. })
  331. minetest.register_craft({
  332. output = "farming:spaghetti",
  333. recipe = {
  334. {"group:food_pasta", "group:food_saucepan", "group:food_tomato"},
  335. {"group:food_garlic_clove", "group:food_garlic_clove", ""}
  336. },
  337. replacements = {{"group:food_saucepan", "farming:saucepan"}}
  338. })
  339. -- Korean Bibimbap
  340. minetest.register_craftitem("farming:bibimbap", {
  341. description = S("Bibimbap"),
  342. inventory_image = "farming_bibimbap.png",
  343. on_use = minetest.item_eat(8, "farming:bowl")
  344. })
  345. minetest.register_craft({
  346. output = "farming:bibimbap",
  347. recipe = {
  348. {"group:food_skillet", "group:food_bowl", "group:food_egg"},
  349. {"group:food_rice", "group:food_chicken_raw", "group:food_cabbage"},
  350. {"group:food_carrot", "group:food_chili_pepper", ""}
  351. },
  352. replacements = {{"group:food_skillet", "farming:skillet"}}
  353. })
  354. minetest.register_craft({
  355. output = "farming:bibimbap",
  356. type = "shapeless",
  357. recipe = {
  358. "group:food_skillet", "group:food_bowl", "group:food_mushroom",
  359. "group:food_rice", "group:food_cabbage", "group:food_carrot",
  360. "group:food_mushroom", "group:food_chili_pepper"
  361. },
  362. replacements = {{"group:food_skillet", "farming:skillet"}}
  363. })
  364. -- Burger
  365. minetest.register_craftitem("farming:burger", {
  366. description = S("Burger"),
  367. inventory_image = "farming_burger.png",
  368. on_use = minetest.item_eat(16),
  369. })
  370. minetest.register_craft({
  371. output = "farming:burger",
  372. recipe = {
  373. {"farming:bread", "group:food_meat", "group:food_cheese"},
  374. {"group:food_tomato", "group:food_cucumber", "group:food_onion"},
  375. {"group:food_lettuce", "", ""}
  376. }
  377. })
  378. -- Salad
  379. minetest.register_craftitem("farming:salad", {
  380. description = S("Salad"),
  381. inventory_image = "farming_salad.png",
  382. on_use = minetest.item_eat(8, "farming:bowl")
  383. })
  384. minetest.register_craft({
  385. output = "farming:salad",
  386. type = "shapeless",
  387. recipe = {
  388. "group:food_bowl", "group:food_tomato", "group:food_cucumber",
  389. "group:food_lettuce", "group:food_oil"
  390. }
  391. })
  392. -- Triple Berry Smoothie
  393. minetest.register_craftitem("farming:smoothie_berry", {
  394. description = S("Triple Berry Smoothie"),
  395. inventory_image = "farming_berry_smoothie.png",
  396. on_use = minetest.item_eat(6, "vessels:drinking_glass"),
  397. groups = {vessel = 1, drink = 1}
  398. })
  399. minetest.register_craft({
  400. output = "farming:smoothie_berry",
  401. type = "shapeless",
  402. recipe = {
  403. "group:food_raspberries", "group:food_blackberries",
  404. "group:food_strawberry", "group:food_banana",
  405. "vessels:drinking_glass"
  406. }
  407. })
  408. -- Patatas a la importancia
  409. minetest.register_craftitem("farming:spanish_potatoes", {
  410. description = S("Spanish Potatoes"),
  411. inventory_image = "farming_spanish_potatoes.png",
  412. on_use = minetest.item_eat(8, "farming:bowl"),
  413. })
  414. minetest.register_craft({
  415. type = "shapeless",
  416. output = "farming:spanish_potatoes",
  417. recipe = {
  418. "farming:potato", "group:food_parsley", "farming:potato",
  419. "group:food_egg", "group:food_flour", "farming:onion",
  420. "farming:garlic_clove", "group:food_bowl", "group:food_skillet"
  421. },
  422. replacements = {{"group:food_skillet", "farming:skillet"}}
  423. })
  424. -- Potato omelet
  425. minetest.register_craftitem("farming:potato_omelet", {
  426. description = S("Potato omelet"),
  427. inventory_image = "farming_potato_omelet.png",
  428. on_use = minetest.item_eat(6, "farming:bowl")
  429. })
  430. minetest.register_craft({
  431. type = "shapeless",
  432. output = "farming:potato_omelet",
  433. recipe = {
  434. "group:food_egg", "farming:potato", "group:food_onion",
  435. "group:food_skillet", "group:food_bowl"},
  436. replacements = {{"group:food_skillet", "farming:skillet"}}
  437. })
  438. -- Paella
  439. minetest.register_craftitem("farming:paella", {
  440. description = S("Paella"),
  441. inventory_image = "farming_paella.png",
  442. on_use = minetest.item_eat(8, "farming:bowl")
  443. })
  444. minetest.register_craft({
  445. type = "shapeless",
  446. output = "farming:paella",
  447. recipe = {
  448. "group:food_rice", "dye:orange", "farming:pepper_red",
  449. "group:food_peas", "group:food_chicken", "group:food_bowl", "group:food_skillet"
  450. },
  451. replacements = {{"group:food_skillet", "farming:skillet"}}
  452. })
  453. -- Flan
  454. minetest.register_craftitem("farming:flan", {
  455. description = S("Vanilla Flan"),
  456. inventory_image = "farming_vanilla_flan.png",
  457. on_use = minetest.item_eat(6)
  458. })
  459. minetest.register_craft({
  460. output = "farming:flan",
  461. recipe = {
  462. {"group:food_sugar", "group:food_milk", "farming:caramel"},
  463. {"group:food_egg", "group:food_egg", "farming:vanilla_extract"}
  464. },
  465. replacements = {
  466. {"cucina_vegana:soy_milk", "vessels:drinking_glass"},
  467. {"group:food_milk", "bucket:bucket_empty"},
  468. {"farming:vanilla_extract", "vessels:glass_bottle"}
  469. }
  470. })
  471. -- Vegan Cheese
  472. minetest.register_craftitem("farming:cheese_vegan", {
  473. description = S("Vegan Cheese"),
  474. inventory_image = "farming_cheese_vegan.png",
  475. on_use = minetest.item_eat(2),
  476. groups = {food_cheese = 1, flammable = 2}
  477. })
  478. minetest.register_craft({
  479. output = "farming:cheese_vegan",
  480. recipe = {
  481. {"farming:soy_milk", "farming:soy_milk", "farming:soy_milk"},
  482. {"group:food_salt", "group:food_peppercorn", "farming:bottle_ethanol"},
  483. {"group:food_gelatin", "group:food_pot", ""}
  484. },
  485. replacements = {
  486. {"farming:soy_milk", "vessels:drinking_glass 3"},
  487. {"farming:pot", "farming:pot"},
  488. {"farming:bottle_ethanol", "vessels:glass_bottle"}
  489. }
  490. })
  491. minetest.register_craft({
  492. output = "farming:cheese_vegan",
  493. recipe = {
  494. {"farming:soy_milk", "farming:soy_milk", "farming:soy_milk"},
  495. {"group:food_salt", "group:food_peppercorn", "group:food_lemon"},
  496. {"group:food_gelatin", "group:food_pot", ""}
  497. },
  498. replacements = {
  499. {"farming:soy_milk", "vessels:drinking_glass 3"},
  500. {"farming:pot", "farming:pot"}
  501. }
  502. })
  503. -- Onigiri
  504. minetest.register_craftitem("farming:onigiri", {
  505. description = S("Onirigi"),
  506. inventory_image = "farming_onigiri.png",
  507. on_use = minetest.item_eat(2),
  508. groups = {flammable = 2}
  509. })
  510. minetest.register_craft({
  511. output = "farming:onigiri",
  512. recipe = {
  513. {"group:food_rice", "group:food_salt", "group:food_rice"},
  514. {"", "group:food_seaweed", ""}
  515. }
  516. })
  517. -- Gyoza
  518. minetest.register_craftitem("farming:gyoza", {
  519. description = S("Gyoza"),
  520. inventory_image = "farming_gyoza.png",
  521. on_use = minetest.item_eat(4),
  522. groups = {flammable = 2}
  523. })
  524. minetest.register_craft({
  525. output = "farming:gyoza 4",
  526. recipe = {
  527. {"group:food_cabbage", "group:food_garlic_clove", "group:food_onion"},
  528. {"group:food_meat_raw", "group:food_salt", "group:food_flour"},
  529. {"", "group:food_skillet", ""}
  530. },
  531. replacements = {
  532. {"group:food_skillet", "farming:skillet"}
  533. }
  534. })
  535. -- Mochi
  536. minetest.register_craftitem("farming:mochi", {
  537. description = S("Mochi"),
  538. inventory_image = "farming_mochi.png",
  539. on_use = minetest.item_eat(3),
  540. groups = {flammable = 2}
  541. })
  542. minetest.register_craft({
  543. output = "farming:mochi",
  544. recipe = {
  545. {"group:food_rice", "group:food_sugar", "group:food_rice"},
  546. {"", "group:food_mortar_pestle", ""},
  547. {"", "bucket:bucket_river_water", ""}
  548. },
  549. replacements = {
  550. {"group:food_mortar_pestle", "farming:mortar_pestle"},
  551. {"bucket:bucket_river_water", "bucket:bucket_empty"}
  552. }
  553. })