food.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. local S = ethereal.intllib
  2. -- Banana (Heals one heart when eaten)
  3. minetest.register_node("ethereal:banana", {
  4. description = S("Banana"),
  5. drawtype = "torchlike",
  6. tiles = {"ethereal_banana_single.png"},
  7. inventory_image = "ethereal_banana_single.png",
  8. wield_image = "ethereal_banana_single.png",
  9. paramtype = "light",
  10. sunlight_propagates = true,
  11. walkable = false,
  12. selection_box = {
  13. type = "fixed",
  14. fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
  15. },
  16. groups = {
  17. food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  18. leafdecay = 1, leafdecay_drop = 1
  19. },
  20. drop = "ethereal:banana",
  21. on_use = minetest.item_eat(2),
  22. sounds = default.node_sound_leaves_defaults(),
  23. after_place_node = function(pos, placer)
  24. if placer:is_player() then
  25. minetest.set_node(pos, {name = "ethereal:banana", param2 = 1})
  26. end
  27. end
  28. })
  29. -- Banana Bunch
  30. minetest.register_node("ethereal:banana_bunch", {
  31. description = S("Banana Bunch"),
  32. drawtype = "torchlike",
  33. tiles = {"ethereal_banana_bunch.png"},
  34. inventory_image = "ethereal_banana_bunch.png",
  35. wield_image = "ethereal_banana_bunch.png",
  36. paramtype = "light",
  37. sunlight_propagates = true,
  38. walkable = false,
  39. selection_box = {
  40. type = "fixed",
  41. fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
  42. },
  43. groups = {
  44. fleshy = 3, dig_immediate = 3, flammable = 2,
  45. leafdecay = 1, leafdecay_drop = 1
  46. },
  47. drop = "ethereal:banana_bunch",
  48. on_use = minetest.item_eat(6),
  49. sounds = default.node_sound_leaves_defaults(),
  50. after_place_node = function(pos, placer)
  51. if placer:is_player() then
  52. minetest.set_node(pos, {name = "ethereal:banana_bunch", param2 = 1})
  53. end
  54. end
  55. })
  56. -- Bunch to Single
  57. minetest.register_craft({
  58. output = "ethereal:banana 3",
  59. recipe = {{"ethereal:banana_bunch"}}
  60. })
  61. minetest.register_craft({
  62. output = "ethereal:banana_bunch",
  63. recipe = {{"ethereal:banana", "ethereal:banana", "ethereal:banana"}}
  64. })
  65. -- Banana Dough
  66. minetest.register_craftitem("ethereal:banana_dough", {
  67. description = S("Banana Dough"),
  68. inventory_image = "ethereal_banana_dough.png"
  69. })
  70. minetest.register_craft({
  71. output = "ethereal:banana_dough",
  72. recipe = {{"group:food_flour", "group:food_banana"}}
  73. })
  74. minetest.register_craft({
  75. type = "cooking",
  76. cooktime = 14,
  77. output = "ethereal:banana_bread",
  78. recipe = "ethereal:banana_dough"
  79. })
  80. -- Orange (Heals 2 hearts when eaten)
  81. minetest.register_node("ethereal:orange", {
  82. description = S("Orange"),
  83. drawtype = "plantlike",
  84. tiles = {"farming_orange.png"},
  85. inventory_image = "farming_orange.png",
  86. wield_image = "farming_orange.png",
  87. paramtype = "light",
  88. sunlight_propagates = true,
  89. walkable = false,
  90. selection_box = {
  91. type = "fixed",
  92. fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
  93. },
  94. groups = {
  95. food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  96. leafdecay = 3, leafdecay_drop = 1
  97. },
  98. drop = "ethereal:orange",
  99. on_use = minetest.item_eat(4),
  100. sounds = default.node_sound_leaves_defaults(),
  101. after_place_node = function(pos, placer)
  102. if placer:is_player() then
  103. minetest.set_node(pos, {name = "ethereal:orange", param2 = 1})
  104. end
  105. end
  106. })
  107. -- Pine Nuts (Heals 1/2 heart when eaten)
  108. minetest.register_craftitem("ethereal:pine_nuts", {
  109. description = S("Pine Nuts"),
  110. inventory_image = "ethereal_pine_nuts.png",
  111. wield_image = "ethereal_pine_nuts.png",
  112. groups = {food_pine_nuts = 1, flammable = 2},
  113. on_use = minetest.item_eat(1)
  114. })
  115. -- Banana Loaf (Heals 3 hearts when eaten)
  116. minetest.register_craftitem("ethereal:banana_bread", {
  117. description = S("Banana Loaf"),
  118. inventory_image = "ethereal_banana_bread.png",
  119. wield_image = "ethereal_banana_bread.png",
  120. groups = {food_bread = 1, flammable = 3},
  121. on_use = minetest.item_eat(6)
  122. })
  123. -- coconut settings if farming redo found
  124. local fredo = minetest.get_modpath("farming") and farming and farming.mod
  125. and farming.mod == "redo"
  126. local cdrp = fredo and "ethereal:coconut" or "ethereal:coconut_slice 4"
  127. local cgrp = fredo and {3, 2} or {1, 1}
  128. -- Coconut (drops 4x coconut slice by default, whole coconut if farming redo found)
  129. minetest.register_node("ethereal:coconut", {
  130. description = S("Coconut"),
  131. drawtype = "plantlike",
  132. walkable = false,
  133. paramtype = "light",
  134. sunlight_propagates = true,
  135. tiles = {"moretrees_coconut.png"},
  136. inventory_image = "moretrees_coconut.png",
  137. wield_image = "moretrees_coconut.png",
  138. selection_box = {
  139. type = "fixed",
  140. fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
  141. },
  142. groups = {
  143. food_coconut = 1, snappy = cgrp[1], oddly_breakable_by_hand = cgrp[2],
  144. cracky = cgrp[1], choppy = cgrp[1], flammable = 1,
  145. leafdecay = 3, leafdecay_drop = 1
  146. },
  147. drop = cdrp,
  148. sounds = default.node_sound_wood_defaults(),
  149. after_place_node = function(pos, placer)
  150. if placer:is_player() then
  151. minetest.set_node(pos, {name = "ethereal:coconut", param2 = 1})
  152. end
  153. end
  154. })
  155. -- Coconut Slice (Heals half heart when eaten)
  156. minetest.register_craftitem("ethereal:coconut_slice", {
  157. description = S("Coconut Slice"),
  158. inventory_image = "moretrees_coconut_slice.png",
  159. wield_image = "moretrees_coconut_slice.png",
  160. groups = {food_coconut_slice = 1, flammable = 1},
  161. on_use = minetest.item_eat(1)
  162. })
  163. -- coconut slice recipe (farming redo)
  164. if fredo then
  165. minetest.register_craft({
  166. output = "ethereal:coconut_slice 4",
  167. recipe = {{"farming:cutting_board", "ethereal:coconut"}},
  168. replacements = {{"farming:cutting_board", "farming:cutting_board"}}
  169. })
  170. end
  171. -- coconut slice into whole coconut
  172. minetest.register_craft({
  173. output = "ethereal:coconut",
  174. recipe = {
  175. {"ethereal:coconut_slice", "ethereal:coconut_slice"},
  176. {"ethereal:coconut_slice", "ethereal:coconut_slice"}
  177. }
  178. })
  179. -- Golden Apple (Found on Healing Tree, heals all 10 hearts)
  180. minetest.register_node("ethereal:golden_apple", {
  181. description = S("Golden Apple"),
  182. drawtype = "plantlike",
  183. tiles = {"default_apple_gold.png"},
  184. inventory_image = "default_apple_gold.png",
  185. wield_image = "default_apple_gold.png",
  186. paramtype = "light",
  187. sunlight_propagates = true,
  188. walkable = false,
  189. selection_box = {
  190. type = "fixed",
  191. fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
  192. },
  193. groups = {
  194. fleshy = 3, dig_immediate = 3,
  195. leafdecay = 3,leafdecay_drop = 1
  196. },
  197. drop = "ethereal:golden_apple",
  198. sounds = default.node_sound_leaves_defaults(),
  199. on_use = function(itemstack, user, pointed_thing)
  200. if user then
  201. user:set_hp(20)
  202. return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
  203. end
  204. end,
  205. after_place_node = function(pos, placer, itemstack)
  206. if placer:is_player() then
  207. minetest.set_node(pos, {name = "ethereal:golden_apple", param2 = 1})
  208. end
  209. end
  210. })
  211. -- Hearty Stew (Heals 5 hearts)
  212. -- thanks to ZonerDarkRevention for his DokuCraft DeviantArt bowl texture)
  213. minetest.register_craftitem("ethereal:hearty_stew", {
  214. description = S("Hearty Stew"),
  215. inventory_image = "ethereal_hearty_stew.png",
  216. wield_image = "ethereal_hearty_stew.png",
  217. on_use = minetest.item_eat(10, "ethereal:bowl")
  218. })
  219. minetest.register_craft({
  220. output = "ethereal:hearty_stew",
  221. recipe = {
  222. {"group:food_onion","flowers:mushroom_brown", "group:food_tuber"},
  223. {"","flowers:mushroom_brown", ""},
  224. {"","group:food_bowl", ""}
  225. }
  226. })
  227. -- Extra recipe for hearty stew
  228. if fredo then
  229. minetest.register_craft({
  230. output = "ethereal:hearty_stew",
  231. recipe = {
  232. {"group:food_onion","flowers:mushroom_brown", "group:food_beans"},
  233. {"","flowers:mushroom_brown", ""},
  234. {"","group:food_bowl", ""}
  235. }
  236. })
  237. end
  238. -- Bucket of Cactus Pulp
  239. minetest.register_craftitem("ethereal:bucket_cactus", {
  240. description = S("Bucket of Cactus Pulp"),
  241. inventory_image = "bucket_cactus.png",
  242. wield_image = "bucket_cactus.png",
  243. stack_max = 1,
  244. groups = {vessel = 1, drink = 1},
  245. on_use = minetest.item_eat(2, "bucket:bucket_empty"),
  246. })
  247. minetest.register_craft({
  248. output = "ethereal:bucket_cactus",
  249. recipe = {{"bucket:bucket_empty","default:cactus"}}
  250. })
  251. -- firethorn jelly
  252. minetest.register_craftitem("ethereal:firethorn_jelly", {
  253. description = S("Firethorn Jelly"),
  254. inventory_image = "ethereal_firethorn_jelly.png",
  255. wield_image = "ethereal_firethorn_jelly.png",
  256. on_use = minetest.item_eat(2, "vessels:glass_bottle"),
  257. groups = {vessel = 1}
  258. })
  259. if minetest.registered_items["farming:bowl"] then
  260. minetest.register_craft({
  261. output = "ethereal:firethorn_jelly",
  262. recipe = {
  263. {"farming:mortar_pestle","vessels:glass_bottle", ""},
  264. {"ethereal:firethorn", "ethereal:firethorn", "ethereal:firethorn"},
  265. {"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"}
  266. },
  267. replacements = {
  268. {"bucket:bucket_water", "bucket:bucket_empty 3"},
  269. {"farming:mortar_pestle", "farming:mortar_pestle"}
  270. }
  271. })
  272. end
  273. -- Lemon
  274. minetest.register_node("ethereal:lemon", {
  275. description = S("Lemon"),
  276. drawtype = "plantlike",
  277. tiles = {"ethereal_lemon.png"},
  278. inventory_image = "ethereal_lemon_fruit.png",
  279. wield_image = "ethereal_lemon_fruit.png",
  280. paramtype = "light",
  281. sunlight_propagates = true,
  282. walkable = false,
  283. selection_box = {
  284. type = "fixed",
  285. fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
  286. },
  287. groups = {
  288. food_lemon = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  289. leafdecay = 3, leafdecay_drop = 1
  290. },
  291. drop = "ethereal:lemon",
  292. on_use = minetest.item_eat(3),
  293. sounds = default.node_sound_leaves_defaults(),
  294. after_place_node = function(pos, placer)
  295. if placer:is_player() then
  296. minetest.set_node(pos, {name = "ethereal:lemon", param2 = 1})
  297. end
  298. end
  299. })
  300. -- Candied Lemon
  301. minetest.register_craftitem("ethereal:candied_lemon", {
  302. description = S("Candied Lemon"),
  303. inventory_image = "ethereal_candied_lemon.png",
  304. wield_image = "ethereal_candied_lemon.png",
  305. groups = {food_candied_lemon = 1},
  306. on_use = minetest.item_eat(5)
  307. })
  308. minetest.register_craft({
  309. output = "ethereal:candied_lemon",
  310. recipe = {
  311. {"farming:baking_tray", "ethereal:lemon", "group:food_sugar"}
  312. },
  313. replacements = {
  314. {"farming:baking_tray", "farming:baking_tray"}
  315. }
  316. })
  317. -- Lemonade
  318. minetest.register_node("ethereal:lemonade", {
  319. description = S("Lemonade"),
  320. drawtype = "plantlike",
  321. tiles = {"ethereal_lemonade.png"},
  322. inventory_image = "ethereal_lemonade.png",
  323. wield_image = "ethereal_lemonade.png",
  324. paramtype = "light",
  325. walkable = false,
  326. selection_box = {
  327. type = "fixed",
  328. fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
  329. },
  330. groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
  331. on_use = minetest.item_eat(5, "vessels:drinking_glass"),
  332. sounds = default.node_sound_glass_defaults()
  333. })
  334. minetest.register_craft({
  335. output = "ethereal:lemonade",
  336. recipe = {
  337. {"ethereal:lemon", "group:food_sugar", "group:food_sugar"},
  338. {"vessels:drinking_glass", "group:water_bucket", ""}
  339. },
  340. replacements = {
  341. {"group:water_bucket", "bucket:bucket_empty"},
  342. }
  343. })
  344. -- Olive
  345. minetest.register_node("ethereal:olive", {
  346. description = S("Olive"),
  347. drawtype = "plantlike",
  348. tiles = {"ethereal_olive.png"},
  349. inventory_image = "ethereal_olive_fruit.png",
  350. wield_image = "ethereal_olive_fruit.png",
  351. visual_scale = 0.2,
  352. paramtype = "light",
  353. sunlight_propagates = true,
  354. walkable = false,
  355. selection_box = {
  356. type = "fixed",
  357. fixed = {-0.1, -0.5, -0.1, 0.1, -0.3, 0.1}
  358. },
  359. groups = {
  360. fleshy = 3, dig_immediate = 3, flammable = 2,
  361. leafdecay = 3, leafdecay_drop = 1
  362. },
  363. drop = "ethereal:olive",
  364. on_use = minetest.item_eat(1),
  365. sounds = default.node_sound_leaves_defaults(),
  366. after_place_node = function(pos, placer)
  367. if placer:is_player() then
  368. minetest.set_node(pos, {name = "ethereal:olive", param2 = 1})
  369. end
  370. end
  371. })
  372. -- Olive Oil
  373. minetest.register_craftitem("ethereal:olive_oil", {
  374. description = S("Olive Oil"),
  375. inventory_image = "ethereal_olive_oil.png",
  376. wield_image = "ethereal_olive_oil.png",
  377. groups = {food_oil = 1, food_olive_oil = 1, vessel = 1}
  378. })
  379. minetest.register_craft({
  380. output = "ethereal:olive_oil",
  381. recipe = {
  382. {"ethereal:olive", "ethereal:olive", "ethereal:olive"},
  383. {"ethereal:olive", "ethereal:olive", "ethereal:olive"},
  384. {"farming:juicer", "vessels:glass_bottle", ""}
  385. },
  386. replacements = {
  387. {"farming:juicer", "farming:juicer"}
  388. }
  389. })
  390. -- Kappa Maki (sushi with cucumber)
  391. minetest.register_craftitem("ethereal:sushi_kappamaki", {
  392. description = S("Kappa Maki Sushi"),
  393. inventory_image = "ethereal_sushi_kappa_maki.png",
  394. on_use = minetest.item_eat(3)
  395. })
  396. minetest.register_craft({
  397. output = "ethereal:sushi_kappamaki 2",
  398. recipe = {
  399. {"group:food_seaweed", "group:food_cucumber", "group:food_rice"}
  400. }
  401. })
  402. -- Nigiri (sushi with raw fish)
  403. minetest.register_craftitem("ethereal:sushi_nigiri", {
  404. description = S("Nigiri Sushi"),
  405. inventory_image = "ethereal_sushi_nigiri.png",
  406. on_use = minetest.item_eat(2)
  407. })
  408. minetest.register_craft({
  409. output = "ethereal:sushi_nigiri 2",
  410. recipe = {
  411. {"group:food_rice", "group:food_fish_raw", ""}
  412. }
  413. })
  414. -- Tamago (sushi with sweet egg)
  415. minetest.register_craftitem("ethereal:sushi_tamago", {
  416. description = S("Tamago Sushi"),
  417. inventory_image = "ethereal_sushi_tamago.png",
  418. on_use = minetest.item_eat(2)
  419. })
  420. minetest.register_craft({
  421. output = "ethereal:sushi_tamago 2",
  422. recipe = {
  423. {"group:food_seaweed", "group:food_egg", "group:food_rice"}
  424. }
  425. })
  426. -- Fugu (prepared pufferfish)
  427. minetest.register_craftitem("ethereal:fugu", {
  428. description = S("Fugusashi"),
  429. inventory_image = "ethereal_fugu.png",
  430. on_use = function(itemstack, user, pointed_thing)
  431. if user then
  432. if math.random(12) == 1 then
  433. return minetest.do_item_eat(-16, nil, itemstack, user, pointed_thing)
  434. else
  435. return minetest.do_item_eat(4, nil, itemstack, user, pointed_thing)
  436. end
  437. end
  438. end
  439. })
  440. minetest.register_craft({
  441. output = "ethereal:fugu",
  442. recipe = {
  443. {"group:food_cutting_board", "ethereal:fish_pufferfish", "group:food_soy_sauce"}
  444. },
  445. replacements = {
  446. {"group:food_cutting_board", "farming:cutting_board"},
  447. {"group:food_soy_sauce", "vessels:glass_bottle"}
  448. }
  449. })
  450. -- Teriyaki Chicken
  451. minetest.register_craftitem("ethereal:teriyaki_chicken", {
  452. description = S("Teriyaki Chicken"),
  453. inventory_image = "ethereal_teriyaki_chicken.png",
  454. on_use = minetest.item_eat(4)
  455. })
  456. minetest.register_craft({
  457. output = "ethereal:teriyaki_chicken 2",
  458. recipe = {
  459. {"group:food_chicken_raw", "group:food_sugar", "group:food_soy_sauce"},
  460. {"group:food_garlic_clove", "group:food_saucepan", "group:food_gelatin"}
  461. },
  462. replacements = {
  463. {"group:food_soy_sauce", "vessels:glass_bottle"},
  464. {"group:food_saucepan", "farming:saucepan"}
  465. }
  466. })
  467. -- Teriyaki Beef
  468. minetest.register_craftitem("ethereal:teriyaki_beef", {
  469. description = S("Teriyaki Beef"),
  470. inventory_image = "ethereal_teriyaki_beef.png",
  471. on_use = minetest.item_eat(12, "ethereal:bowl")
  472. })
  473. minetest.register_craft({
  474. output = "ethereal:teriyaki_beef",
  475. recipe = {
  476. {"group:food_meat_raw", "group:food_sugar", "group:food_soy_sauce"},
  477. {"group:food_garlic_clove", "group:food_saucepan", "group:food_gelatin"},
  478. {"group:food_cabbage", "group:food_rice", "group:food_bowl"}
  479. },
  480. replacements = {
  481. {"group:food_soy_sauce", "vessels:glass_bottle"},
  482. {"group:food_saucepan", "farming:saucepan"}
  483. }
  484. })
  485. -- mushroom soup (Heals 1 heart)
  486. minetest.register_craftitem("ethereal:mushroom_soup", {
  487. description = S("Mushroom Soup"),
  488. inventory_image = "ethereal_mushroom_soup.png",
  489. groups = {drink = 1},
  490. on_use = minetest.item_eat(5, "ethereal:bowl")
  491. })
  492. minetest.register_craft({
  493. output = "ethereal:mushroom_soup",
  494. recipe = {
  495. {"group:food_mushroom"},
  496. {"group:food_mushroom"},
  497. {"group:food_bowl"}
  498. }
  499. })