soy.lua 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. local S = farming.intllib
  2. -- soy pod
  3. minetest.register_craftitem("farming:soy_pod", {
  4. description = S("Soy Pod"),
  5. inventory_image = "farming_soy_pod.png",
  6. groups = {seed = 2, food_soy_pod = 1, flammable = 2},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:soy_1")
  9. end
  10. })
  11. minetest.register_craftitem("farming:soy_beans", {
  12. description = S("Soy Beans"),
  13. inventory_image = "farming_soy_beans.png",
  14. groups = {food_soy = 1, flammable = 2},
  15. on_use = minetest.item_eat(1)
  16. })
  17. minetest.register_craft({
  18. output = "farming:soy_beans",
  19. recipe = {{"farming:soy_pod"}}
  20. })
  21. -- soy sauce
  22. minetest.register_node("farming:soy_sauce", {
  23. description = S("Soy Sauce"),
  24. drawtype = "plantlike",
  25. tiles = {"farming_soy_sauce.png"},
  26. inventory_image = "farming_soy_sauce.png",
  27. wield_image = "farming_soy_sauce.png",
  28. paramtype = "light",
  29. walkable = false,
  30. selection_box = {
  31. type = "fixed",
  32. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  33. },
  34. groups = {
  35. vessel = 1, food_soy_sauce = 1, dig_immediate = 3, attached_node = 1
  36. },
  37. sounds = default.node_sound_glass_defaults()
  38. })
  39. -- soy sauce recipe
  40. minetest.register_craft( {
  41. output = "farming:soy_sauce",
  42. recipe = {
  43. {"group:food_soy", "group:food_salt", "group:food_soy"},
  44. {"", "group:food_juicer", ""},
  45. {"", "bucket:bucket_water", "vessels:glass_bottle"}
  46. },
  47. replacements = {
  48. {"bucket:bucket_water", "bucket:bucket_empty"},
  49. {"group:food_juicer", "farming:juicer"}
  50. }
  51. })
  52. -- soy milk
  53. minetest.register_node("farming:soy_milk", {
  54. description = S("Soy Milk"),
  55. drawtype = "plantlike",
  56. tiles = {"farming_soy_milk_glass.png"},
  57. inventory_image = "farming_soy_milk_glass.png",
  58. wield_image = "farming_soy_milk_glass.png",
  59. paramtype = "light",
  60. walkable = false,
  61. selection_box = {
  62. type = "fixed",
  63. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  64. },
  65. on_use = minetest.item_eat(2, "vessels:drinking_glass"),
  66. groups = {
  67. vessel = 1, food_milk_glass = 1, dig_immediate = 3,
  68. attached_node = 1, drink = 1
  69. },
  70. sounds = default.node_sound_glass_defaults()
  71. })
  72. minetest.register_craft( {
  73. output = "farming:soy_milk",
  74. recipe = {
  75. {"group:food_soy", "group:food_soy", "group:food_soy"},
  76. {"farming:vanilla_extract", "bucket:bucket_water", "vessels:drinking_glass"}
  77. },
  78. replacements = {
  79. {"bucket:bucket_water", "bucket:bucket_empty"},
  80. {"farming:vanilla_extract", "vessels:glass_bottle"}
  81. }
  82. })
  83. -- tofu
  84. minetest.register_craftitem("farming:tofu", {
  85. description = S("Tofu"),
  86. inventory_image = "farming_tofu.png",
  87. groups = {food_tofu = 1, food_meat_raw = 1, flammable = 2},
  88. on_use = minetest.item_eat(3)
  89. })
  90. minetest.register_craft({
  91. output = "farming:tofu",
  92. recipe = {
  93. {"farming:baking_tray", "group:food_soy", "group:food_soy"},
  94. {"group:food_soy", "group:food_soy", "group:food_soy"}
  95. },
  96. replacements = {{"farming:baking_tray", "farming:baking_tray"}}
  97. })
  98. -- cooked tofu
  99. minetest.register_craftitem("farming:tofu_cooked", {
  100. description = S("Cooked Tofu"),
  101. inventory_image = "farming_tofu_cooked.png",
  102. groups = {food_meat = 1, flammable = 2},
  103. on_use = minetest.item_eat(6)
  104. })
  105. minetest.register_craft({
  106. type = "cooking",
  107. output = "farming:tofu_cooked",
  108. recipe = "farming:tofu",
  109. cooktime = 5
  110. })
  111. -- crop definition
  112. local def = {
  113. drawtype = "plantlike",
  114. tiles = {"farming_soy_1.png"},
  115. paramtype = "light",
  116. paramtype2 = "meshoptions",
  117. place_param2 = 3,
  118. sunlight_propagates = true,
  119. waving = 1,
  120. walkable = false,
  121. buildable_to = true,
  122. drop = "",
  123. selection_box = farming.select,
  124. groups = {
  125. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  126. not_in_creative_inventory = 1, growing = 1
  127. },
  128. sounds = default.node_sound_leaves_defaults()
  129. }
  130. -- stage 1
  131. minetest.register_node("farming:soy_1", table.copy(def))
  132. -- stage 2
  133. def.tiles = {"farming_soy_2.png"}
  134. minetest.register_node("farming:soy_2", table.copy(def))
  135. -- stage 3
  136. def.tiles = {"farming_soy_3.png"}
  137. minetest.register_node("farming:soy_3", table.copy(def))
  138. -- stage 4
  139. def.tiles = {"farming_soy_4.png"}
  140. minetest.register_node("farming:soy_4", table.copy(def))
  141. -- stage 5
  142. def.tiles = {"farming_soy_5.png"}
  143. def.drop = {
  144. max_items = 1, items = {
  145. {items = {"farming:soy_pod"}, rarity = 1},
  146. }
  147. }
  148. minetest.register_node("farming:soy_5", table.copy(def))
  149. -- stage 6
  150. def.tiles = {"farming_soy_6.png"}
  151. def.drop = {
  152. max_items = 3, items = {
  153. {items = {"farming:soy_pod"}, rarity = 1},
  154. {items = {"farming:soy_pod"}, rarity = 2},
  155. {items = {"farming:soy_pod"}, rarity = 3},
  156. }
  157. }
  158. minetest.register_node("farming:soy_6", table.copy(def))
  159. -- stage 7
  160. def.tiles = {"farming_soy_7.png"}
  161. def.groups.growing = nil
  162. def.drop = {
  163. max_items = 5, items = {
  164. {items = {"farming:soy_pod"}, rarity = 1},
  165. {items = {"farming:soy_pod"}, rarity = 2},
  166. {items = {"farming:soy_pod"}, rarity = 3},
  167. {items = {"farming:soy_pod"}, rarity = 4},
  168. {items = {"farming:soy_pod"}, rarity = 5}
  169. }
  170. }
  171. minetest.register_node("farming:soy_7", table.copy(def))
  172. -- add to registered_plants
  173. farming.registered_plants["farming:soy_pod"] = {
  174. crop = "farming:soy",
  175. seed = "farming:soy_pod",
  176. minlight = farming.min_light,
  177. maxlight = farming.max_light,
  178. steps = 7
  179. }