food.lua 6.4 KB

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