food.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. -- Unregister all foods first.
  2. hunger.food = {}
  3. local register_food = hunger.register_food
  4. register_food("basictrees:tree_apple", 2)
  5. if minetest.get_modpath("farming") ~= nil then
  6. register_food("farming:bread", 4)
  7. end
  8. if minetest.get_modpath("flowers") ~= nil then
  9. register_food("flowers:mushroom_brown", 1)
  10. -- Mushroom poisoning is handled in the flowers mod.
  11. -- register_food("flowers:mushroom_red", 1, "", 3)
  12. end
  13. if minetest.get_modpath("mobs") ~= nil then
  14. if mobs.mod ~= nil and mobs.mod == "redo" then
  15. register_food("mobs:cheese", 4)
  16. register_food("mobs:meat", 8)
  17. register_food("mobs:meat_raw", 4)
  18. register_food("mobs:rat_cooked", 4)
  19. register_food("mobs:honey", 3)
  20. register_food("mobs:pork_raw", 3, "", 3)
  21. register_food("mobs:pork_cooked", 8)
  22. register_food("mobs:chicken_cooked", 6)
  23. register_food("mobs:chicken_raw", 2, "", 3)
  24. register_food("mobs:chicken_egg_fried", 2)
  25. if minetest.get_modpath("bucket") then
  26. register_food("mobs:bucket_milk", 3, "bucket:bucket_empty")
  27. end
  28. else
  29. register_food("mobs:meat", 6)
  30. register_food("mobs:meat_raw", 3)
  31. register_food("mobs:rat_cooked", 5)
  32. end
  33. end
  34. if minetest.get_modpath("moretrees") ~= nil then
  35. -- Prevent interference.
  36. --[[
  37. register_food("moretrees:coconut_milk", 0)
  38. register_food("moretrees:raw_coconut", 3)
  39. register_food("moretrees:acorn_muffin", 8)
  40. register_food("moretrees:spruce_nuts", 1)
  41. register_food("moretrees:pine_nuts", 3)
  42. register_food("moretrees:fir_nuts", 3)
  43. --]]
  44. end
  45. if minetest.get_modpath("dwarves") ~= nil then
  46. register_food("dwarves:beer", 2)
  47. register_food("dwarves:apple_cider", 1)
  48. register_food("dwarves:midus", 2)
  49. register_food("dwarves:tequila", 2)
  50. register_food("dwarves:tequila_with_lime", 2)
  51. register_food("dwarves:sake", 2)
  52. end
  53. if minetest.get_modpath("animalmaterials") ~= nil then
  54. register_food("animalmaterials:milk", 2)
  55. register_food("animalmaterials:meat_raw", 3)
  56. register_food("animalmaterials:meat_pork", 3)
  57. register_food("animalmaterials:meat_beef", 3)
  58. register_food("animalmaterials:meat_chicken", 3)
  59. register_food("animalmaterials:meat_lamb", 3)
  60. register_food("animalmaterials:meat_venison", 3)
  61. register_food("animalmaterials:meat_undead", 3, "", 3)
  62. register_food("animalmaterials:meat_toxic", 3, "", 5)
  63. register_food("animalmaterials:meat_ostrich", 3)
  64. register_food("animalmaterials:fish_bluewhite", 2)
  65. register_food("animalmaterials:fish_clownfish", 2)
  66. end
  67. if minetest.get_modpath("fishing") ~= nil then
  68. register_food("fishing:fish_raw", 2)
  69. register_food("fishing:fish_cooked", 5)
  70. register_food("fishing:sushi", 6)
  71. register_food("fishing:shark", 4)
  72. register_food("fishing:shark_cooked", 8)
  73. register_food("fishing:pike", 4)
  74. register_food("fishing:pike_cooked", 8)
  75. end
  76. if minetest.get_modpath("glooptest") ~= nil then
  77. register_food("glooptest:kalite_lump", 1)
  78. end
  79. if minetest.get_modpath("bushes") ~= nil then
  80. register_food("bushes:sugar", 1)
  81. register_food("bushes:strawberry", 2)
  82. register_food("bushes:berry_pie_raw", 3)
  83. register_food("bushes:berry_pie_cooked", 4)
  84. register_food("bushes:basket_pies", 15)
  85. end
  86. if minetest.get_modpath("bushes_classic") then
  87. -- bushes_classic mod, as found in the plantlife modpack
  88. local berries = {
  89. "strawberry",
  90. "blackberry",
  91. "blueberry",
  92. "raspberry",
  93. "gooseberry",
  94. "mixed_berry",
  95. }
  96. for _, berry in ipairs(berries) do
  97. if berry ~= "mixed_berry" then
  98. register_food("bushes:"..berry, 1)
  99. end
  100. register_food("bushes:"..berry.."_pie_raw", 2)
  101. register_food("bushes:"..berry.."_pie_cooked", 5)
  102. register_food("bushes:basket_"..berry, 15)
  103. end
  104. end
  105. if minetest.get_modpath("mushroom") ~= nil then
  106. register_food("mushroom:brown", 1)
  107. register_food("mushroom:red", 1, "", 3)
  108. -- mushroom potions: red = strong poison, brown = light restorative
  109. if minetest.get_modpath("vessels") then
  110. register_food("mushroom:brown_essence", 1, "vessels:glass_bottle", nil, 4)
  111. register_food("mushroom:poison", 1, "vessels:glass_bottle", 10)
  112. end
  113. end
  114. if minetest.get_modpath("docfarming") ~= nil then
  115. register_food("docfarming:carrot", 3)
  116. register_food("docfarming:cucumber", 2)
  117. register_food("docfarming:corn", 3)
  118. register_food("docfarming:potato", 4)
  119. register_food("docfarming:bakedpotato", 5)
  120. register_food("docfarming:raspberry", 3)
  121. end
  122. if minetest.get_modpath("farming_plus") ~= nil then
  123. register_food("farming_plus:carrot_item", 3)
  124. register_food("farming_plus:banana", 2)
  125. register_food("farming_plus:orange_item", 2)
  126. register_food("farming:pumpkin_bread", 4)
  127. register_food("farming_plus:strawberry_item", 2)
  128. register_food("farming_plus:tomato_item", 2)
  129. register_food("farming_plus:potato_item", 4)
  130. register_food("farming_plus:rhubarb_item", 2)
  131. end
  132. if minetest.get_modpath("mtfoods") ~= nil then
  133. register_food("mtfoods:dandelion_milk", 1)
  134. register_food("mtfoods:sugar", 1)
  135. register_food("mtfoods:short_bread", 4)
  136. register_food("mtfoods:cream", 1)
  137. register_food("mtfoods:chocolate", 2)
  138. register_food("mtfoods:cupcake", 2)
  139. register_food("mtfoods:strawberry_shortcake", 2)
  140. register_food("mtfoods:cake", 3)
  141. register_food("mtfoods:chocolate_cake", 3)
  142. register_food("mtfoods:carrot_cake", 3)
  143. register_food("mtfoods:pie_crust", 3)
  144. register_food("mtfoods:apple_pie", 3)
  145. register_food("mtfoods:rhubarb_pie", 2)
  146. register_food("mtfoods:banana_pie", 3)
  147. register_food("mtfoods:pumpkin_pie", 3)
  148. register_food("mtfoods:cookies", 2)
  149. register_food("mtfoods:mlt_burger", 5)
  150. register_food("mtfoods:potato_slices", 2)
  151. register_food("mtfoods:potato_chips", 3)
  152. --mtfoods:medicine
  153. register_food("mtfoods:casserole", 3)
  154. register_food("mtfoods:glass_flute", 2)
  155. register_food("mtfoods:orange_juice", 2)
  156. register_food("mtfoods:apple_juice", 2)
  157. register_food("mtfoods:apple_cider", 2)
  158. register_food("mtfoods:cider_rack", 2)
  159. end
  160. if minetest.get_modpath("fruit") ~= nil then
  161. register_food("fruit:apple", 2)
  162. register_food("fruit:pear", 2)
  163. register_food("fruit:bananna", 3)
  164. register_food("fruit:orange", 2)
  165. end
  166. if minetest.get_modpath("mush45") ~= nil then
  167. register_food("mush45:meal", 4)
  168. end
  169. if minetest.get_modpath("seaplants") ~= nil then
  170. register_food("seaplants:kelpgreen", 1)
  171. register_food("seaplants:kelpbrown", 1)
  172. register_food("seaplants:seagrassgreen", 1)
  173. register_food("seaplants:seagrassred", 1)
  174. register_food("seaplants:seasaladmix", 6)
  175. register_food("seaplants:kelpgreensalad", 1)
  176. register_food("seaplants:kelpbrownsalad", 1)
  177. register_food("seaplants:seagrassgreensalad", 1)
  178. register_food("seaplants:seagrassgreensalad", 1)
  179. end
  180. if minetest.get_modpath("mobfcooking") ~= nil then
  181. register_food("mobfcooking:cooked_pork", 6)
  182. register_food("mobfcooking:cooked_ostrich", 6)
  183. register_food("mobfcooking:cooked_beef", 6)
  184. register_food("mobfcooking:cooked_chicken", 6)
  185. register_food("mobfcooking:cooked_lamb", 6)
  186. register_food("mobfcooking:cooked_venison", 6)
  187. register_food("mobfcooking:cooked_fish", 6)
  188. end
  189. if minetest.get_modpath("creatures") ~= nil then
  190. register_food("creatures:meat", 6)
  191. register_food("creatures:flesh", 3)
  192. register_food("creatures:rotten_flesh", 3, "", 3)
  193. end
  194. if minetest.get_modpath("ethereal") then
  195. register_food("ethereal:strawberry", 1)
  196. register_food("ethereal:banana", 4)
  197. register_food("ethereal:pine_nuts", 1)
  198. register_food("ethereal:bamboo_sprout", 0, "", 3)
  199. register_food("ethereal:fern_tubers", 1)
  200. register_food("ethereal:banana_bread", 7)
  201. register_food("ethereal:mushroom_plant", 2)
  202. register_food("ethereal:coconut_slice", 2)
  203. register_food("ethereal:golden_apple", 4, "", nil, 10)
  204. register_food("ethereal:wild_onion_plant", 2)
  205. register_food("ethereal:mushroom_soup", 4, "ethereal:bowl")
  206. register_food("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl")
  207. register_food("ethereal:hearty_stew", 6, "ethereal:bowl", 3)
  208. register_food("ethereal:hearty_stew_cooked", 10, "ethereal:bowl")
  209. if minetest.get_modpath("bucket") then
  210. register_food("ethereal:bucket_cactus", 2, "bucket:bucket_empty")
  211. end
  212. register_food("ethereal:fish_raw", 2)
  213. register_food("ethereal:fish_cooked", 5)
  214. register_food("ethereal:seaweed", 1)
  215. register_food("ethereal:yellowleaves", 1, "", nil, 1)
  216. register_food("ethereal:sashimi", 4)
  217. end
  218. if minetest.get_modpath("farming") and farming.mod == "redo" then
  219. register_food("farming:bread", 6)
  220. register_food("farming:potato", 1)
  221. register_food("farming:baked_potato", 6)
  222. register_food("farming:cucumber", 4)
  223. register_food("farming:tomato", 4)
  224. register_food("farming:carrot", 3)
  225. register_food("farming:carrot_gold", 6, "", nil, 8)
  226. register_food("farming:corn", 3)
  227. register_food("farming:corn_cob", 5)
  228. register_food("farming:melon_slice", 2)
  229. register_food("farming:pumpkin_slice", 1)
  230. register_food("farming:pumpkin_bread", 9)
  231. register_food("farming:coffee_cup", 2, "farming:drinking_cup")
  232. register_food("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2)
  233. register_food("farming:cookie", 2)
  234. register_food("farming:chocolate_dark", 3)
  235. register_food("farming:donut", 4)
  236. register_food("farming:donut_chocolate", 6)
  237. register_food("farming:donut_apple", 6)
  238. register_food("farming:raspberries", 1)
  239. register_food("farming:blueberries", 1)
  240. register_food("farming:coffeebeans", 1)
  241. register_food("farming:muffin_blueberry", 4)
  242. if minetest.get_modpath("vessels") then
  243. register_food("farming:smoothie_raspberry", 2, "vessels:drinking_glass")
  244. end
  245. register_food("farming:rhubarb", 1)
  246. register_food("farming:rhubarb_pie", 6)
  247. register_food("farming:beans", 1)
  248. end
  249. if minetest.get_modpath("kpgmobs") ~= nil then
  250. register_food("kpgmobs:uley", 3)
  251. register_food("kpgmobs:meat", 6)
  252. register_food("kpgmobs:rat_cooked", 5)
  253. register_food("kpgmobs:med_cooked", 4)
  254. if minetest.get_modpath("bucket") then
  255. register_food("kpgmobs:bucket_milk", 4, "bucket:bucket_empty")
  256. end
  257. end
  258. if minetest.get_modpath("jkfarming") ~= nil then
  259. register_food("jkfarming:carrot", 3)
  260. register_food("jkfarming:corn", 3)
  261. register_food("jkfarming:melon_part", 2)
  262. register_food("jkfarming:cake", 3)
  263. end
  264. if minetest.get_modpath("jkanimals") ~= nil then
  265. register_food("jkanimals:meat", 6)
  266. end
  267. if minetest.get_modpath("jkwine") ~= nil then
  268. register_food("jkwine:grapes", 2)
  269. register_food("jkwine:winebottle", 1)
  270. end
  271. if minetest.get_modpath("cooking") ~= nil then
  272. register_food("cooking:meat_beef_cooked", 4)
  273. register_food("cooking:fish_bluewhite_cooked", 3)
  274. register_food("cooking:fish_clownfish_cooked", 1)
  275. register_food("cooking:meat_chicken_cooked", 2)
  276. register_food("cooking:meat_cooked", 2)
  277. register_food("cooking:meat_pork_cooked", 3)
  278. register_food("cooking:meat_toxic_cooked", -3)
  279. register_food("cooking:meat_venison_cooked", 3)
  280. register_food("cooking:meat_undead_cooked", 1)
  281. end
  282. -- ferns mod of plantlife_modpack
  283. if minetest.get_modpath("ferns") ~= nil then
  284. register_food("ferns:fiddlehead", 1, "", 1)
  285. register_food("ferns:fiddlehead_roasted", 3)
  286. register_food("ferns:ferntuber_roasted", 3)
  287. register_food("ferns:horsetail_01", 1)
  288. end
  289. if minetest.get_modpath("pizza") ~= nil then
  290. register_food("pizza:pizza", 30, "", nil, 30)
  291. register_food("pizza:pizzaslice", 5, "", nil, 5)
  292. end