food.lua 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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. --= Salt
  15. minetest.register_node("farming:salt", {
  16. description = S("Salt"),
  17. inventory_image = "farming_salt.png",
  18. wield_image = "farming_salt.png",
  19. drawtype = "plantlike",
  20. visual_scale = 0.8,
  21. paramtype = "light",
  22. tiles = {"farming_salt.png"},
  23. groups = {food_salt = 1, vessel = 1, dig_immediate = 3,
  24. attached_node = 1},
  25. sounds = default.node_sound_defaults(),
  26. selection_box = {
  27. type = "fixed",
  28. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  29. }
  30. })
  31. minetest.register_craft({
  32. type = "cooking",
  33. cooktime = 15,
  34. output = "farming:salt",
  35. recipe = "bucket:bucket_water",
  36. replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
  37. })
  38. --= Rose Water
  39. minetest.register_node("farming:rose_water", {
  40. description = S("Rose Water"),
  41. inventory_image = "farming_rose_water.png",
  42. wield_image = "farming_rose_water.png",
  43. drawtype = "plantlike",
  44. visual_scale = 0.8,
  45. paramtype = "light",
  46. tiles = {"farming_rose_water.png"},
  47. groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3,
  48. attached_node = 1},
  49. sounds = default.node_sound_defaults(),
  50. selection_box = {
  51. type = "fixed",
  52. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  53. }
  54. })
  55. minetest.register_craft({
  56. output = "farming:rose_water",
  57. recipe = {
  58. {"flowers:rose", "flowers:rose", "flowers:rose"},
  59. {"flowers:rose", "flowers:rose", "flowers:rose"},
  60. {"group:water_bucket", "group:food_pot", "vessels:glass_bottle"}
  61. },
  62. replacements = {
  63. {"group:water_bucket", "bucket:bucket_empty"},
  64. {"group:food_pot", "farming:pot"}
  65. }
  66. })
  67. if minetest.get_modpath("bucket_wooden") then
  68. minetest.register_craft({
  69. output = "farming:rose_water",
  70. recipe = {
  71. {"flowers:rose", "flowers:rose", "flowers:rose"},
  72. {"flowers:rose", "flowers:rose", "flowers:rose"},
  73. {"group:water_bucket_wooden", "group:food_pot", "vessels:glass_bottle"}
  74. },
  75. replacements = {
  76. {"group:water_bucket_wooden", "bucket_wooden:bucket_empty"},
  77. {"group:food_pot", "farming:pot"}
  78. }
  79. })
  80. end
  81. --= Turkish Delight
  82. minetest.register_craftitem("farming:turkish_delight", {
  83. description = S("Turkish Delight"),
  84. inventory_image = "farming_turkish_delight.png",
  85. groups = {flammable = 3},
  86. on_use = minetest.item_eat(2)
  87. })
  88. minetest.register_craft({
  89. output = "farming:turkish_delight 4",
  90. recipe = {
  91. {"group:food_gelatin", "group:food_sugar", "group:food_gelatin"},
  92. {"group:food_sugar", "group:food_rose_water", "group:food_sugar"},
  93. {"group:food_cornstarch", "group:food_sugar", "dye:pink"}
  94. },
  95. replacements = {
  96. {"group:food_cornstarch", "farming:bowl"},
  97. {"group:food_rose_water", "vessels:glass_bottle"}
  98. }
  99. })
  100. --= Garlic Bread
  101. minetest.register_craftitem("farming:garlic_bread", {
  102. description = S("Garlic Bread"),
  103. inventory_image = "farming_garlic_bread.png",
  104. groups = {flammable = 3},
  105. on_use = minetest.item_eat(2)
  106. })
  107. minetest.register_craft({
  108. type = "shapeless",
  109. output = "farming:garlic_bread",
  110. recipe = {"group:food_toast", "group:food_garlic_clove", "group:food_garlic_clove"}
  111. })
  112. --= Donuts (thanks to Bockwurst for making the donut images)
  113. minetest.register_craftitem("farming:donut", {
  114. description = S("Donut"),
  115. inventory_image = "farming_donut.png",
  116. on_use = minetest.item_eat(4)
  117. })
  118. minetest.register_craft({
  119. output = "farming:donut 3",
  120. recipe = {
  121. {"", "group:food_wheat", ""},
  122. {"group:food_wheat", "group:food_sugar", "group:food_wheat"},
  123. {"", "group:food_wheat", ""}
  124. }
  125. })
  126. minetest.register_craftitem("farming:donut_chocolate", {
  127. description = S("Chocolate Donut"),
  128. inventory_image = "farming_donut_chocolate.png",
  129. on_use = minetest.item_eat(6)
  130. })
  131. minetest.register_craft({
  132. output = "farming:donut_chocolate",
  133. recipe = {
  134. {"group:food_cocoa"},
  135. {"farming:donut"}
  136. }
  137. })
  138. minetest.register_craftitem("farming:donut_apple", {
  139. description = S("Apple Donut"),
  140. inventory_image = "farming_donut_apple.png",
  141. on_use = minetest.item_eat(6)
  142. })
  143. minetest.register_craft({
  144. output = "farming:donut_apple",
  145. recipe = {
  146. {"default:apple"},
  147. {"farming:donut"}
  148. }
  149. })
  150. --= Porridge Oats
  151. minetest.register_craftitem("farming:porridge", {
  152. description = S("Porridge"),
  153. inventory_image = "farming_porridge.png",
  154. on_use = minetest.item_eat(6, "farming:bowl")
  155. })
  156. minetest.register_craft({
  157. type = "shapeless",
  158. output = "farming:porridge",
  159. recipe = {
  160. "group:food_oats", "group:food_oats", "group:food_oats",
  161. "group:food_oats", "group:food_bowl", "group:food_milk_glass"
  162. },
  163. replacements = {
  164. {"mobs:glass_milk", "vessels:drinking_glass"},
  165. {"farming:soy_milk", "vessels:drinking_glass"}
  166. }
  167. })
  168. --= Jaffa Cake
  169. minetest.register_craftitem("farming:jaffa_cake", {
  170. description = S("Jaffa Cake"),
  171. inventory_image = "farming_jaffa_cake.png",
  172. on_use = minetest.item_eat(6)
  173. })
  174. minetest.register_craft({
  175. type = "shapeless",
  176. output = "farming:jaffa_cake",
  177. recipe = {
  178. "farming:baking_tray", "group:food_egg", "group:food_sugar",
  179. "group:food_flour", "group:food_cocoa", "group:food_orange",
  180. "group:food_milk"
  181. },
  182. replacements = {
  183. {"farming:baking_tray", "farming:baking_tray"},
  184. {"mobs:bucket_milk", "bucket:bucket_empty"}
  185. }
  186. })
  187. -- Apple Pie
  188. minetest.register_craftitem("farming:apple_pie", {
  189. description = S("Apple Pie"),
  190. inventory_image = "farming_apple_pie.png",
  191. on_use = minetest.item_eat(6)
  192. })
  193. minetest.register_craft({
  194. output = "farming:apple_pie",
  195. type = "shapeless",
  196. recipe = {
  197. "group:food_flour", "group:food_sugar",
  198. "group:food_apple", "group:food_baking_tray"
  199. },
  200. replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
  201. })
  202. -- Cactus Juice
  203. minetest.register_craftitem("farming:cactus_juice", {
  204. description = S("Cactus Juice"),
  205. inventory_image = "farming_cactus_juice.png",
  206. groups = {vessel = 1, drink = 1},
  207. on_use = function(itemstack, user, pointed_thing)
  208. if user then
  209. if math.random(5) == 1 then
  210. return minetest.do_item_eat(-1, "vessels:drinking_glass",
  211. itemstack, user, pointed_thing)
  212. else
  213. return minetest.do_item_eat(2, "vessels:drinking_glass",
  214. itemstack, user, pointed_thing)
  215. end
  216. end
  217. end
  218. })
  219. minetest.register_craft({
  220. output = "farming:cactus_juice 2",
  221. type = "shapeless",
  222. recipe = {
  223. "vessels:drinking_glass", "vessels:drinking_glass",
  224. "default:cactus", "farming:juicer"
  225. },
  226. replacements = {
  227. {"group:food_juicer", "farming:juicer"}
  228. }
  229. })
  230. -- Pasta
  231. minetest.register_craftitem("farming:pasta", {
  232. description = S("Pasta"),
  233. inventory_image = "farming_pasta.png",
  234. groups = {food_pasta = 1}
  235. })
  236. if minetest.get_modpath("mobs_animal") or minetest.get_modpath("xanadu")then
  237. minetest.register_craft({
  238. output = "farming:pasta",
  239. type = "shapeless",
  240. recipe = {
  241. "group:food_flour", "group:food_mixing_bowl",
  242. "group:food_butter"
  243. },
  244. replacements = {{"group:food_mixing_bowl", "farming:mixing_bowl"}}
  245. })
  246. else
  247. minetest.register_craft({
  248. output = "farming:pasta",
  249. type = "shapeless",
  250. recipe = {
  251. "group:food_flour", "group:food_mixing_bowl",
  252. "group:food_oil"
  253. },
  254. replacements = {
  255. {"group:food_mixing_bowl", "farming:mixing_bowl"},
  256. {"group:food_oil", "vessels:glass_bottle"}
  257. }
  258. })
  259. end
  260. -- Spaghetti
  261. minetest.register_craftitem("farming:spaghetti", {
  262. description = S("Spaghetti"),
  263. inventory_image = "farming_spaghetti.png",
  264. on_use = minetest.item_eat(8)
  265. })
  266. minetest.register_craft({
  267. output = "farming:spaghetti",
  268. type = "shapeless",
  269. recipe = {
  270. "group:food_pasta", "group:food_saucepan",
  271. "group:food_tomato", "group:food_garlic_clove", "group:food_garlic_clove"
  272. },
  273. replacements = {{"group:food_saucepan", "farming:saucepan"}}
  274. })
  275. -- Korean Bibimbap
  276. minetest.register_craftitem("farming:bibimbap", {
  277. description = S("Bibimbap"),
  278. inventory_image = "farming_bibimbap.png",
  279. on_use = minetest.item_eat(8, "farming:bowl")
  280. })
  281. if minetest.get_modpath("mobs_animal") or minetest.get_modpath("xanadu")then
  282. minetest.register_craft({
  283. output = "farming:bibimbap",
  284. type = "shapeless",
  285. recipe = {
  286. "group:food_skillet", "group:food_bowl", "group:food_egg", "group:food_rice",
  287. "group:food_chicken_raw", "group:food_cabbage", "group:food_carrot",
  288. "group:food_chili_pepper"
  289. },
  290. replacements = {{"group:food_skillet", "farming:skillet"}}
  291. })
  292. else
  293. minetest.register_craft({
  294. output = "farming:bibimbap",
  295. type = "shapeless",
  296. recipe = {
  297. "group:food_skillet", "group:food_bowl", "group:food_mushroom",
  298. "group:food_rice", "group:food_cabbage", "group:food_carrot",
  299. "group:food_mushroom", "group:food_chili_pepper"
  300. },
  301. replacements = {{"group:food_skillet", "farming:skillet"}}
  302. })
  303. end
  304. -- Burger
  305. minetest.register_craftitem("farming:burger", {
  306. description = S("Burger"),
  307. inventory_image = "farming_burger.png",
  308. on_use = minetest.item_eat(16),
  309. })
  310. minetest.register_craft({
  311. type = "shapeless",
  312. output = "farming:burger",
  313. recipe = {
  314. "farming:bread", "group:food_meat", "group:food_cheese",
  315. "group:food_tomato", "group:food_cucumber", "group:food_onion",
  316. "group:food_lettuce"
  317. }
  318. })
  319. -- Salad
  320. minetest.register_craftitem("farming:salad", {
  321. description = S("Salad"),
  322. inventory_image = "farming_salad.png",
  323. on_use = minetest.item_eat(8, "farming:bowl")
  324. })
  325. minetest.register_craft({
  326. output = "farming:salad",
  327. type = "shapeless",
  328. recipe = {
  329. "group:food_bowl", "group:food_tomato", "group:food_cucumber",
  330. "group:food_lettuce", "group:food_oil"
  331. },
  332. })
  333. -- Triple Berry Smoothie
  334. minetest.register_craftitem("farming:smoothie_berry", {
  335. description = S("Triple Berry Smoothie"),
  336. inventory_image = "farming_berry_smoothie.png",
  337. on_use = minetest.item_eat(6, "vessels:drinking_glass"),
  338. groups = {vessel = 1, drink = 1}
  339. })
  340. minetest.register_craft({
  341. output = "farming:smoothie_berry",
  342. type = "shapeless",
  343. recipe = {
  344. "group:food_raspberries", "group:food_blackberries",
  345. "group:food_strawberry", "group:food_banana",
  346. "vessels:drinking_glass"
  347. }
  348. })