blackberry.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. local S = farming.intllib
  2. -- blackberries
  3. minetest.register_craftitem("farming:blackberry", {
  4. description = S("Blackberries"),
  5. inventory_image = "farming_blackberry.png",
  6. groups = {seed = 2, food_blackberries = 1, food_blackberry = 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:blackberry_1")
  10. end,
  11. on_use = minetest.item_eat(1),
  12. })
  13. local def = {
  14. drawtype = "plantlike",
  15. tiles = {"farming_blackberry_1.png"},
  16. paramtype = "light",
  17. sunlight_propagates = true,
  18. walkable = false,
  19. buildable_to = true,
  20. drop = "",
  21. selection_box = farming.select,
  22. groups = {
  23. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  24. not_in_creative_inventory = 1, growing = 1
  25. },
  26. sounds = default.node_sound_leaves_defaults()
  27. }
  28. -- stage 1
  29. minetest.register_node("farming:blackberry_1", table.copy(def))
  30. -- stage 2
  31. def.tiles = {"farming_blackberry_2.png"}
  32. minetest.register_node("farming:blackberry_2", table.copy(def))
  33. -- stage 3
  34. def.tiles = {"farming_blackberry_3.png"}
  35. minetest.register_node("farming:blackberry_3", table.copy(def))
  36. -- stage 4
  37. def.tiles = {"farming_blackberry_4.png"}
  38. def.groups.growing = nil
  39. def.drop = {
  40. items = {
  41. {items = {'farming:blackberry 2'}, rarity = 1},
  42. {items = {'farming:blackberry'}, rarity = 2},
  43. {items = {'farming:blackberry'}, rarity = 3},
  44. }
  45. }
  46. minetest.register_node("farming:blackberry_4", table.copy(def))
  47. -- add to registered_plants
  48. farming.registered_plants["farming:blackberry"] = {
  49. crop = "farming:blackberry",
  50. seed = "farming:blackberry",
  51. minlight = farming.min_light,
  52. maxlight = farming.max_light,
  53. steps = 4
  54. }