food.lua 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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 = {"banana_single.png"},
  7. inventory_image = "banana_single.png",
  8. wield_image = "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 = {"banana_bunch.png"},
  34. inventory_image = "banana_bunch.png",
  35. wield_image = "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. type = "shapeless",
  59. output = "ethereal:banana 3",
  60. recipe = {"ethereal:banana_bunch"}
  61. })
  62. minetest.register_craft({
  63. type = "shapeless",
  64. output = "ethereal:banana_bunch",
  65. recipe = {"ethereal:banana", "ethereal:banana", "ethereal:banana"}
  66. })
  67. -- Banana Dough
  68. minetest.register_craftitem("ethereal:banana_dough", {
  69. description = S("Banana Dough"),
  70. inventory_image = "banana_dough.png",
  71. })
  72. minetest.register_craft({
  73. type = "shapeless",
  74. output = "ethereal:banana_dough",
  75. recipe = {"group:food_flour", "group:food_banana"}
  76. })
  77. minetest.register_craft({
  78. type = "cooking",
  79. cooktime = 14,
  80. output = "ethereal:banana_bread",
  81. recipe = "ethereal:banana_dough"
  82. })
  83. -- Orange (Heals 2 hearts when eaten)
  84. minetest.register_node("ethereal:orange", {
  85. description = S("Orange"),
  86. drawtype = "plantlike",
  87. tiles = {"farming_orange.png"},
  88. inventory_image = "farming_orange.png",
  89. wield_image = "farming_orange.png",
  90. paramtype = "light",
  91. sunlight_propagates = true,
  92. walkable = false,
  93. selection_box = {
  94. type = "fixed",
  95. fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
  96. },
  97. groups = {
  98. food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  99. leafdecay = 3, leafdecay_drop = 1
  100. },
  101. drop = "ethereal:orange",
  102. on_use = minetest.item_eat(4),
  103. sounds = default.node_sound_leaves_defaults(),
  104. after_place_node = function(pos, placer)
  105. if placer:is_player() then
  106. minetest.set_node(pos, {name = "ethereal:orange", param2 = 1})
  107. end
  108. end,
  109. })
  110. -- Pine Nuts (Heals 1/2 heart when eaten)
  111. minetest.register_craftitem("ethereal:pine_nuts", {
  112. description = S("Pine Nuts"),
  113. inventory_image = "pine_nuts.png",
  114. wield_image = "pine_nuts.png",
  115. groups = {food_pine_nuts = 1, flammable = 2},
  116. on_use = minetest.item_eat(1),
  117. })
  118. -- Banana Loaf (Heals 3 hearts when eaten)
  119. minetest.register_craftitem("ethereal:banana_bread", {
  120. description = S("Banana Loaf"),
  121. inventory_image = "banana_bread.png",
  122. wield_image = "banana_bread.png",
  123. groups = {food_bread = 1, flammable = 3},
  124. on_use = minetest.item_eat(6),
  125. })
  126. -- Coconut (Gives 4 coconut slices, each heal 1/2 heart)
  127. minetest.register_node("ethereal:coconut", {
  128. description = S("Coconut"),
  129. drawtype = "plantlike",
  130. walkable = false,
  131. paramtype = "light",
  132. sunlight_propagates = true,
  133. tiles = {"moretrees_coconut.png"},
  134. inventory_image = "moretrees_coconut.png",
  135. wield_image = "moretrees_coconut.png",
  136. selection_box = {
  137. type = "fixed",
  138. fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
  139. },
  140. groups = {
  141. food_coconut = 1, snappy = 1, oddly_breakable_by_hand = 1, cracky = 1,
  142. choppy = 1, flammable = 1, leafdecay = 3, leafdecay_drop = 1
  143. },
  144. drop = "ethereal:coconut_slice 4",
  145. sounds = default.node_sound_wood_defaults(),
  146. })
  147. -- Coconut Slice (Heals half heart when eaten)
  148. minetest.register_craftitem("ethereal:coconut_slice", {
  149. description = S("Coconut Slice"),
  150. inventory_image = "moretrees_coconut_slice.png",
  151. wield_image = "moretrees_coconut_slice.png",
  152. groups = {food_coconut_slice = 1, flammable = 1},
  153. on_use = minetest.item_eat(1),
  154. })
  155. -- Golden Apple (Found on Healing Tree, heals all 10 hearts)
  156. minetest.register_node("ethereal:golden_apple", {
  157. description = S("Golden Apple"),
  158. drawtype = "plantlike",
  159. tiles = {"default_apple_gold.png"},
  160. inventory_image = "default_apple_gold.png",
  161. wield_image = "default_apple_gold.png",
  162. paramtype = "light",
  163. sunlight_propagates = true,
  164. walkable = false,
  165. selection_box = {
  166. type = "fixed",
  167. fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
  168. },
  169. groups = {
  170. fleshy = 3, dig_immediate = 3,
  171. leafdecay = 3,leafdecay_drop = 1
  172. },
  173. drop = "ethereal:golden_apple",
  174. -- on_use = minetest.item_eat(20),
  175. on_use = function(itemstack, user, pointed_thing)
  176. if user then
  177. user:set_hp(20)
  178. return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
  179. end
  180. end,
  181. sounds = default.node_sound_leaves_defaults(),
  182. after_place_node = function(pos, placer, itemstack)
  183. if placer:is_player() then
  184. minetest.set_node(pos, {name = "ethereal:golden_apple", param2 = 1})
  185. end
  186. end,
  187. })
  188. -- Hearty Stew (Heals 5 hearts - thanks to ZonerDarkRevention for his DokuCraft DeviantArt bowl texture)
  189. minetest.register_craftitem("ethereal:hearty_stew", {
  190. description = S("Hearty Stew"),
  191. inventory_image = "hearty_stew.png",
  192. wield_image = "hearty_stew.png",
  193. on_use = minetest.item_eat(10, "ethereal:bowl"),
  194. })
  195. minetest.register_craft({
  196. output = "ethereal:hearty_stew",
  197. recipe = {
  198. {"group:food_onion","flowers:mushroom_brown", "group:food_tuber"},
  199. {"","flowers:mushroom_brown", ""},
  200. {"","group:food_bowl", ""},
  201. }
  202. })
  203. -- Extra recipe for hearty stew
  204. if farming and farming.mod and farming.mod == "redo" then
  205. minetest.register_craft({
  206. output = "ethereal:hearty_stew",
  207. recipe = {
  208. {"group:food_onion","flowers:mushroom_brown", "group:food_beans"},
  209. {"","flowers:mushroom_brown", ""},
  210. {"","group:food_bowl", ""},
  211. }
  212. })
  213. end
  214. -- Bucket of Cactus Pulp
  215. minetest.register_craftitem("ethereal:bucket_cactus", {
  216. description = S("Bucket of Cactus Pulp"),
  217. inventory_image = "bucket_cactus.png",
  218. wield_image = "bucket_cactus.png",
  219. stack_max = 1,
  220. groups = {vessel = 1, drink = 1},
  221. on_use = minetest.item_eat(2, "bucket:bucket_empty"),
  222. })
  223. minetest.register_craft({
  224. output = "ethereal:bucket_cactus",
  225. recipe = {
  226. {"bucket:bucket_empty","default:cactus"},
  227. }
  228. })
  229. -- firethorn jelly
  230. minetest.register_craftitem("ethereal:firethorn_jelly", {
  231. description = S("Firethorn Jelly"),
  232. inventory_image = "ethereal_firethorn_jelly.png",
  233. wield_image = "ethereal_firethorn_jelly.png",
  234. on_use = minetest.item_eat(2, "vessels:glass_bottle"),
  235. groups = {vessel = 1},
  236. })
  237. if minetest.registered_items["farming:bowl"] then
  238. minetest.register_craft({
  239. type = "shapeless",
  240. output = "ethereal:firethorn_jelly",
  241. recipe = {
  242. "farming:mortar_pestle","vessels:glass_bottle",
  243. "ethereal:firethorn", "ethereal:firethorn", "ethereal:firethorn",
  244. "bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water",
  245. },
  246. replacements = {
  247. {"bucket:bucket_water", "bucket:bucket_empty 3"},
  248. {"farming:mortar_pestle", "farming:mortar_pestle"},
  249. },
  250. })
  251. end