wheat.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. minetest.register_craftitem("farming:wheat_seed", {
  2. description = "Wheat Seeds",
  3. inventory_image = "farming_wheat_seed.png",
  4. on_place = function(itemstack, placer, pointed_thing)
  5. local above = minetest.env:get_node(pointed_thing.above)
  6. if above.name == "air" then
  7. above.name = "farming:wheat_1"
  8. minetest.env:set_node(pointed_thing.above, above)
  9. itemstack:take_item(1)
  10. return itemstack
  11. end
  12. end
  13. })
  14. minetest.register_node("farming:wheat_1", {
  15. paramtype = "light",
  16. sunlight_propagates = true,
  17. walkable = false,
  18. drawtype = "raillike",
  19. drop = "",
  20. tiles = {"farming_wheat_seed.png"},
  21. selection_box = {
  22. type = "fixed",
  23. fixed = {
  24. {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5}
  25. },
  26. },
  27. groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
  28. sounds = default.node_sound_leaves_defaults(),
  29. })
  30. minetest.register_node("farming:wheat_2", {
  31. sunlight_propagates = true,
  32. paramtype = "light",
  33. walkable = false,
  34. drawtype = "nodebox",
  35. drop = "",
  36. tiles = {"farming_wheat_2.png"},
  37. node_box = {
  38. type = "fixed",
  39. fixed = {{-1.5/5, -2.5/5, -1.5/5, -0.5/5, -0.5/5, -0.5/5},{0.5/5, -2.5/5, 0.5/5, 1.5/5, -0.5/5, 1.5/5},{0.5/5, -2.5/5, -1.5/5, 1.5/5, 0.5/5, -0.5/5},{-1.5/5, -2.5/5, 0.5/5, -0.5/5, 0.5/5, 1.5/5},},
  40. },
  41. groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
  42. sounds = default.node_sound_leaves_defaults(),
  43. })
  44. minetest.register_node("farming:wheat_3", {
  45. sunlight_propagates = true,
  46. paramtype = "light",
  47. walkable = false,
  48. drawtype = "nodebox",
  49. drop = "",
  50. tiles = {"farming_wheat_3.png"},
  51. node_box = {
  52. type = "fixed",
  53. fixed = {{-1.5/5, -2.5/5, -1.5/5, -0.5/5, 1.5/5, -0.5/5},{0.5/5, -2.5/5, -1.5/5, 1.5/5, 2.5/5, -0.5/5},{0.5/5, -2.5/5, 0.5/5, 1.5/5, 1.5/5, 1.5/5},{-1.5/5, -2.5/5, 0.5/5, -0.5/5, 2.5/5, 1.5/5}},
  54. },
  55. groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
  56. sounds = default.node_sound_leaves_defaults(),
  57. })
  58. minetest.register_node("farming:wheat", {
  59. sunlight_propagates = true,
  60. paramtype = "light",
  61. walkable = false,
  62. drawtype = "nodebox",
  63. tiles = {"farming_wheat.png"},
  64. drop = {
  65. max_items = 4,
  66. items = {
  67. { items = {'farming:wheat_seed'} },
  68. { items = {'farming:wheat_seed'}, rarity = 2},
  69. { items = {'farming:wheat_seed'}, rarity = 5},
  70. { items = {'farming:wheat_harvested'} }
  71. }
  72. },
  73. node_box = {
  74. type = "fixed",
  75. fixed = {{-1.5/5, -2.5/5, -1.5/5, -0.5/5, 2.5/5, -0.5/5},{0.5/5, -2.5/5, -1.5/5, 1.5/5, 2.5/5, -0.5/5},{0.5/5, -2.5/5, 0.5/5, 1.5/5, 2.5/5, 1.5/5},{-1.5/5, -2.5/5, 0.5/5, -0.5/5, 2.5/5, 1.5/5},},
  76. },
  77. groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
  78. sounds = default.node_sound_leaves_defaults(),
  79. })
  80. farming:add_plant("farming:wheat", {"farming:wheat_1", "farming:wheat_2", "farming:wheat_3"}, 50, 20)
  81. minetest.register_craftitem("farming:wheat_harvested", {
  82. description = "Harvested Wheat",
  83. inventory_image = "farming_wheat_harvested.png",
  84. })
  85. minetest.register_craft({
  86. output = "farming:flour",
  87. recipe = {
  88. {"farming:wheat_harvested", }
  89. }
  90. })
  91. minetest.register_craftitem("farming:flour", {
  92. description = "Flour",
  93. inventory_image = "farming_flour.png",
  94. })
  95. minetest.register_craft({
  96. output = "farming:dough",
  97. type = "shapeless",
  98. recipe = {"farming:flour", "farming:flour", "farming:flour", "farming:flour", "bucket:bucket_water"},
  99. replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
  100. })
  101. minetest.register_alias("farming:cake_mix","farming:dough")
  102. minetest.register_craftitem("farming:dough", {
  103. description = "Bread Dough",
  104. inventory_image = "farming_cake_mix.png",
  105. })
  106. minetest.register_craft({
  107. type = "cooking",
  108. output = "farming:bread",
  109. recipe = "farming:dough",
  110. cooktime = 10
  111. })
  112. minetest.register_craftitem("farming:bread", {
  113. description = "Bread",
  114. inventory_image = "farming_bread.png",
  115. groups = {food=2},
  116. on_use = minetest.item_eat(10)
  117. })
  118. minetest.register_craftitem("farming:pumpkin_bread", {
  119. description = "Pumpkin Bread",
  120. inventory_image = "farming_bread_pumpkin.png",
  121. stack_max = 1,
  122. on_use = minetest.item_eat(20)
  123. })
  124. minetest.register_craftitem("farming:pumpkin_cake_mix", {
  125. description = "Pumpkin Cake Mix",
  126. inventory_image = "farming_cake_mix_pumpkin.png",
  127. })
  128. minetest.register_craft({
  129. output = "farming:pumpkin_cake_mix",
  130. type = "shapeless",
  131. recipe = {"farming:cake_mix", "farming:pumpkin"}
  132. })
  133. minetest.register_craft({
  134. type = "cooking",
  135. output = "farming:pumpkin_bread",
  136. recipe = "farming:pumpkin_cake_mix",
  137. cooktime = 10
  138. })
  139. minetest.register_alias("farming:corn_seed", "farming:wheat_seed")
  140. minetest.register_alias("farming:corn_1", "farming:wheat_1")
  141. minetest.register_alias("farming:corn_2", "farming:wheat_2")
  142. minetest.register_alias("farming:corn_3", "farming:wheat_3")
  143. minetest.register_alias("farming:corn", "farming:wheat")
  144. minetest.register_alias("farming:corn_harvested", "farming:wheat_harvested")
  145. -- ========= FUEL =========
  146. minetest.register_craft({
  147. type = "fuel",
  148. recipe = "farming:wheat_seed",
  149. burntime = 1
  150. })
  151. minetest.register_craft({
  152. type = "fuel",
  153. recipe = "farming:wheat_harvested",
  154. burntime = 2
  155. })