beetroot.lua 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 crop_def = {
  35. drawtype = "plantlike",
  36. tiles = {"farming_beetroot_1.png"},
  37. paramtype = "light",
  38. -- paramtype2 = "meshoptions",
  39. -- place_param2 = 3,
  40. sunlight_propagates = true,
  41. waving = 1,
  42. walkable = false,
  43. buildable_to = true,
  44. drop = "",
  45. selection_box = farming.select,
  46. groups = {
  47. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  48. not_in_creative_inventory = 1, growing = 1
  49. },
  50. sounds = default.node_sound_leaves_defaults()
  51. }
  52. -- stage 1
  53. minetest.register_node("farming:beetroot_1", table.copy(crop_def))
  54. -- stage 2
  55. crop_def.tiles = {"farming_beetroot_2.png"}
  56. minetest.register_node("farming:beetroot_2", table.copy(crop_def))
  57. -- stage 3
  58. crop_def.tiles = {"farming_beetroot_3.png"}
  59. minetest.register_node("farming:beetroot_3", table.copy(crop_def))
  60. -- stage 4
  61. crop_def.tiles = {"farming_beetroot_4.png"}
  62. minetest.register_node("farming:beetroot_4", table.copy(crop_def))
  63. -- stage 5
  64. crop_def.tiles = {"farming_beetroot_5.png"}
  65. crop_def.groups.growing = 0
  66. crop_def.drop = {
  67. max_items = 4, items = {
  68. {items = {"farming:beetroot"}, rarity = 1},
  69. {items = {"farming:beetroot"}, rarity = 2},
  70. {items = {"farming:beetroot"}, rarity = 3},
  71. {items = {"farming:beetroot"}, rarity = 4},
  72. }
  73. }
  74. minetest.register_node("farming:beetroot_5", table.copy(crop_def))
  75. -- add to registered_plants
  76. farming.registered_plants["farming:beetroot"] = {
  77. crop = "farming:beetroot",
  78. seed = "farming:beetroot",
  79. minlight = 13,
  80. maxlight = 15,
  81. steps = 5
  82. }