beetroot.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. output = "farming:beetroot_soup",
  21. recipe = {
  22. {"group:food_beetroot", "group:food_beetroot", "group:food_beetroot"},
  23. {"group:food_beetroot", "group:food_bowl", "group:food_beetroot"}
  24. }
  25. })
  26. -- red dye
  27. minetest.register_craft({
  28. output = "dye:red",
  29. recipe = {{"group:food_beetroot"}}
  30. })
  31. local def = {
  32. drawtype = "plantlike",
  33. tiles = {"farming_beetroot_1.png"},
  34. paramtype = "light",
  35. sunlight_propagates = true,
  36. waving = 1,
  37. walkable = false,
  38. buildable_to = true,
  39. drop = "",
  40. selection_box = farming.select,
  41. groups = {
  42. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  43. not_in_creative_inventory = 1, growing = 1
  44. },
  45. sounds = default.node_sound_leaves_defaults()
  46. }
  47. -- stage 1
  48. minetest.register_node("farming:beetroot_1", table.copy(def))
  49. -- stage 2
  50. def.tiles = {"farming_beetroot_2.png"}
  51. minetest.register_node("farming:beetroot_2", table.copy(def))
  52. -- stage 3
  53. def.tiles = {"farming_beetroot_3.png"}
  54. minetest.register_node("farming:beetroot_3", table.copy(def))
  55. -- stage 4
  56. def.tiles = {"farming_beetroot_4.png"}
  57. minetest.register_node("farming:beetroot_4", table.copy(def))
  58. -- stage 5
  59. def.tiles = {"farming_beetroot_5.png"}
  60. def.groups.growing = nil
  61. def.drop = {
  62. max_items = 4, items = {
  63. {items = {"farming:beetroot"}, rarity = 1},
  64. {items = {"farming:beetroot"}, rarity = 2},
  65. {items = {"farming:beetroot"}, rarity = 3},
  66. {items = {"farming:beetroot"}, rarity = 4}
  67. }
  68. }
  69. minetest.register_node("farming:beetroot_5", table.copy(def))
  70. -- add to registered_plants
  71. farming.registered_plants["farming:beetroot"] = {
  72. crop = "farming:beetroot",
  73. seed = "farming:beetroot",
  74. minlight = farming.min_light,
  75. maxlight = farming.max_light,
  76. steps = 5
  77. }