blueberry.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. local S = farming.intllib
  2. -- blueberries
  3. minetest.register_craftitem("farming:blueberries", {
  4. description = S("Wild Blueberries"),
  5. inventory_image = "farming_blueberries.png",
  6. groups = {seed = 2, food_blueberries = 1, food_blueberry = 1,
  7. food_berry = 1, flammable = 2},
  8. on_place = function(itemstack, placer, pointed_thing)
  9. return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
  10. end,
  11. on_use = minetest.item_eat(1)
  12. })
  13. -- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image)
  14. minetest.register_craftitem("farming:muffin_blueberry", {
  15. description = S("Blueberry Muffin"),
  16. inventory_image = "farming_blueberry_muffin.png",
  17. on_use = minetest.item_eat(2)
  18. })
  19. minetest.register_craft({
  20. output = "farming:muffin_blueberry 2",
  21. recipe = {
  22. {"group:food_blueberries", "group:food_bread", "group:food_blueberries"}
  23. }
  24. })
  25. -- Blueberry Pie
  26. minetest.register_craftitem("farming:blueberry_pie", {
  27. description = S("Blueberry Pie"),
  28. inventory_image = "farming_blueberry_pie.png",
  29. on_use = minetest.item_eat(6)
  30. })
  31. minetest.register_craft({
  32. output = "farming:blueberry_pie",
  33. type = "shapeless",
  34. recipe = {
  35. "group:food_flour", "group:food_sugar",
  36. "group:food_blueberries", "group:food_baking_tray"
  37. },
  38. replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
  39. })
  40. -- blueberry definition
  41. local def = {
  42. drawtype = "plantlike",
  43. tiles = {"farming_blueberry_1.png"},
  44. paramtype = "light",
  45. sunlight_propagates = true,
  46. walkable = false,
  47. buildable_to = true,
  48. drop = "",
  49. selection_box = farming.select,
  50. groups = {
  51. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  52. not_in_creative_inventory = 1, growing = 1
  53. },
  54. sounds = default.node_sound_leaves_defaults()
  55. }
  56. -- stage 1
  57. minetest.register_node("farming:blueberry_1", table.copy(def))
  58. -- stage 2
  59. def.tiles = {"farming_blueberry_2.png"}
  60. minetest.register_node("farming:blueberry_2", table.copy(def))
  61. -- stage 3
  62. def.tiles = {"farming_blueberry_3.png"}
  63. minetest.register_node("farming:blueberry_3", table.copy(def))
  64. -- stage 4 (final)
  65. def.tiles = {"farming_blueberry_4.png"}
  66. def.groups.growing = nil
  67. def.drop = {
  68. items = {
  69. {items = {"farming:blueberries 2"}, rarity = 1},
  70. {items = {"farming:blueberries"}, rarity = 2},
  71. {items = {"farming:blueberries"}, rarity = 3},
  72. }
  73. }
  74. minetest.register_node("farming:blueberry_4", table.copy(def))
  75. -- add to registered_plants
  76. farming.registered_plants["farming:blueberries"] = {
  77. crop = "farming:blueberry",
  78. seed = "farming:blueberries",
  79. minlight = farming.min_light,
  80. maxlight = farming.max_light,
  81. steps = 4
  82. }