blueberry.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. local S = farming.intllib
  2. -- blueberries
  3. minetest.register_craftitem("farming:blueberries", {
  4. description = S("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 crop_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(crop_def))
  58. -- stage 2
  59. crop_def.tiles = {"farming_blueberry_2.png"}
  60. minetest.register_node("farming:blueberry_2", table.copy(crop_def))
  61. -- stage 3
  62. crop_def.tiles = {"farming_blueberry_3.png"}
  63. minetest.register_node("farming:blueberry_3", table.copy(crop_def))
  64. -- stage 4 (final)
  65. crop_def.tiles = {"farming_blueberry_4.png"}
  66. crop_def.groups.growing = 0
  67. crop_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(crop_def))
  75. -- add to registered_plants
  76. farming.registered_plants["farming:blueberries"] = {
  77. crop = "farming:blueberry",
  78. seed = "farming:blueberries",
  79. minlight = 13,
  80. maxlight = 15,
  81. steps = 4
  82. }