food.lua 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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. {"bucket:bucket_water", "group:food_pot", "vessels:glass_bottle"}
  61. },
  62. replacements = {
  63. {"bucket:bucket_water", "bucket:bucket_empty"},
  64. {"group:food_pot", "farming:pot"}
  65. }
  66. })
  67. --= Turkish Delight
  68. minetest.register_craftitem("farming:turkish_delight", {
  69. description = S("Turkish Delight"),
  70. inventory_image = "farming_turkish_delight.png",
  71. groups = {flammable = 3},
  72. on_use = minetest.item_eat(2)
  73. })
  74. minetest.register_craft({
  75. output = "farming:turkish_delight 4",
  76. recipe = {
  77. {"group:food_gelatin", "group:food_sugar", "group:food_gelatin"},
  78. {"group:food_sugar", "group:food_rose_water", "group:food_sugar"},
  79. {"group:food_cornstarch", "group:food_sugar", "dye:pink"}
  80. },
  81. replacements = {
  82. {"group:food_cornstarch", "farming:bowl"},
  83. {"group:food_rose_water", "vessels:glass_bottle"}
  84. }
  85. })
  86. --= Garlic Bread
  87. minetest.register_craftitem("farming:garlic_bread", {
  88. description = S("Garlic Bread"),
  89. inventory_image = "farming_garlic_bread.png",
  90. groups = {flammable = 3},
  91. on_use = minetest.item_eat(2)
  92. })
  93. minetest.register_craft({
  94. type = "shapeless",
  95. output = "farming:garlic_bread",
  96. recipe = {"group:food_toast", "group:food_garlic_clove", "group:food_garlic_clove"}
  97. })
  98. --= Donuts (thanks to Bockwurst for making the donut images)
  99. minetest.register_craftitem("farming:donut", {
  100. description = S("Donut"),
  101. inventory_image = "farming_donut.png",
  102. on_use = minetest.item_eat(4)
  103. })
  104. minetest.register_craft({
  105. output = "farming:donut 3",
  106. recipe = {
  107. {"", "group:food_wheat", ""},
  108. {"group:food_wheat", "group:food_sugar", "group:food_wheat"},
  109. {"", "group:food_wheat", ""}
  110. }
  111. })
  112. minetest.register_craftitem("farming:donut_chocolate", {
  113. description = S("Chocolate Donut"),
  114. inventory_image = "farming_donut_chocolate.png",
  115. on_use = minetest.item_eat(6)
  116. })
  117. minetest.register_craft({
  118. output = "farming:donut_chocolate",
  119. recipe = {
  120. {"group:food_cocoa"},
  121. {"farming:donut"}
  122. }
  123. })
  124. minetest.register_craftitem("farming:donut_apple", {
  125. description = S("Apple Donut"),
  126. inventory_image = "farming_donut_apple.png",
  127. on_use = minetest.item_eat(6)
  128. })
  129. minetest.register_craft({
  130. output = "farming:donut_apple",
  131. recipe = {
  132. {"default:apple"},
  133. {"farming:donut"}
  134. }
  135. })
  136. --= Porridge Oats
  137. minetest.register_craftitem("farming:porridge", {
  138. description = S("Porridge"),
  139. inventory_image = "farming_porridge.png",
  140. on_use = minetest.item_eat(6, "farming:bowl")
  141. })
  142. minetest.after(0, function()
  143. local fluid = "bucket:bucket_water"
  144. local fluid_return = "bucket:bucket_water"
  145. if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then
  146. fluid = "group:food_milk"
  147. fluid_return = "mobs:bucket_milk"
  148. end
  149. minetest.register_craft({
  150. type = "shapeless",
  151. output = "farming:porridge",
  152. recipe = {
  153. "group:food_barley", "group:food_barley", "group:food_wheat",
  154. "group:food_wheat", "group:food_bowl", fluid
  155. },
  156. replacements = {{fluid_return, "bucket:bucket_empty"}}
  157. })
  158. minetest.register_craft({
  159. type = "shapeless",
  160. output = "farming:porridge",
  161. recipe = {
  162. "group:food_oats", "group:food_oats", "group:food_oats",
  163. "group:food_oats", "group:food_bowl", fluid
  164. },
  165. replacements = {{fluid_return, "bucket:bucket_empty"}}
  166. })
  167. end)
  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