beetroot.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. local S = farming.intllib
  2. -- beetroot
  3. minetest.register_craftitem("farming:beetroot", {
  4. description = S("Beetroot"),
  5. inventory_image = "farming_beetroot.png",
  6. groups = {seed = 2, food_beetroot = 1, flammable = 2},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1")
  9. end,
  10. on_use = minetest.item_eat(1)
  11. })
  12. -- beetroot soup
  13. minetest.register_craftitem("farming:beetroot_soup", {
  14. description = S("Beetroot Soup"),
  15. inventory_image = "farming_beetroot_soup.png",
  16. groups = {flammable = 2},
  17. on_use = minetest.item_eat(6, "farming:bowl")
  18. })
  19. minetest.register_craft({
  20. type = "shapeless",
  21. output = "farming:beetroot_soup",
  22. recipe = {
  23. "group:food_beetroot", "group:food_beetroot",
  24. "group:food_beetroot", "group:food_beetroot",
  25. "group:food_beetroot", "group:food_beetroot","group:food_bowl"
  26. }
  27. })
  28. -- red dye
  29. minetest.register_craft({
  30. type = "shapeless",
  31. output = "dye:red",
  32. recipe = {"group:food_beetroot"}
  33. })
  34. local def = {
  35. drawtype = "plantlike",
  36. tiles = {"farming_beetroot_1.png"},
  37. paramtype = "light",
  38. sunlight_propagates = true,
  39. waving = 1,
  40. walkable = false,
  41. buildable_to = true,
  42. drop = "",
  43. selection_box = farming.select,
  44. groups = {
  45. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  46. not_in_creative_inventory = 1, growing = 1
  47. },
  48. sounds = default.node_sound_leaves_defaults()
  49. }
  50. -- stage 1
  51. minetest.register_node("farming:beetroot_1", table.copy(def))
  52. -- stage 2
  53. def.tiles = {"farming_beetroot_2.png"}
  54. minetest.register_node("farming:beetroot_2", table.copy(def))
  55. -- stage 3
  56. def.tiles = {"farming_beetroot_3.png"}
  57. minetest.register_node("farming:beetroot_3", table.copy(def))
  58. -- stage 4
  59. def.tiles = {"farming_beetroot_4.png"}
  60. minetest.register_node("farming:beetroot_4", table.copy(def))
  61. -- stage 5
  62. def.tiles = {"farming_beetroot_5.png"}
  63. def.groups.growing = nil
  64. def.drop = {
  65. max_items = 4, items = {
  66. {items = {"farming:beetroot"}, rarity = 1},
  67. {items = {"farming:beetroot"}, rarity = 2},
  68. {items = {"farming:beetroot"}, rarity = 3},
  69. {items = {"farming:beetroot"}, rarity = 4}
  70. }
  71. }
  72. minetest.register_node("farming:beetroot_5", table.copy(def))
  73. -- add to registered_plants
  74. farming.registered_plants["farming:beetroot"] = {
  75. crop = "farming:beetroot",
  76. seed = "farming:beetroot",
  77. minlight = farming.min_light,
  78. maxlight = farming.max_light,
  79. steps = 5
  80. }