berries.lua 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. minetest.register_craftitem("lottfarming:berries_seed", {
  2. description = "Berries Seeds",
  3. inventory_image = "lottfarming_berries_seed.png",
  4. on_place = function(itemstack, placer, pointed_thing)
  5. return place_seed(itemstack, placer, pointed_thing, "lottfarming:berries_1", 34)
  6. end,
  7. })
  8. minetest.register_node("lottfarming:berries_1", {
  9. paramtype = "light",
  10. paramtype2 = "meshoptions",
  11. walkable = false,
  12. drawtype = "plantlike",
  13. drop = "",
  14. tiles = {"lottfarming_berries_1.png"},
  15. waving = 1,
  16. selection_box = {
  17. type = "fixed",
  18. fixed = {
  19. {-0.5, -0.5, -0.5, 0.5, -0.5+5/16, 0.5}
  20. },
  21. },
  22. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  23. sounds = default.node_sound_leaves_defaults(),
  24. })
  25. minetest.register_node("lottfarming:berries_2", {
  26. paramtype = "light",
  27. paramtype2 = "meshoptions",
  28. walkable = false,
  29. drawtype = "plantlike",
  30. drop = "",
  31. tiles = {"lottfarming_berries_2.png"},
  32. waving = 1,
  33. selection_box = {
  34. type = "fixed",
  35. fixed = {
  36. {-0.5, -0.5, -0.5, 0.5, -0.5+8/16, 0.5}
  37. },
  38. },
  39. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  40. sounds = default.node_sound_leaves_defaults(),
  41. })
  42. minetest.register_node("lottfarming:berries_3", {
  43. paramtype = "light",
  44. paramtype2 = "meshoptions",
  45. walkable = false,
  46. drawtype = "plantlike",
  47. drop = "",
  48. tiles = {"lottfarming_berries_3.png"},
  49. waving = 1,
  50. selection_box = {
  51. type = "fixed",
  52. fixed = {
  53. {-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
  54. },
  55. },
  56. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  57. sounds = default.node_sound_leaves_defaults(),
  58. })
  59. minetest.register_node("lottfarming:berries_4", {
  60. paramtype = "light",
  61. paramtype2 = "meshoptions",
  62. walkable = false,
  63. drawtype = "plantlike",
  64. tiles = {"lottfarming_berries_4.png"},
  65. waving = 1,
  66. drop = {
  67. max_items = 6,
  68. items = {
  69. { items = {'lottfarming:berries_seed'} },
  70. { items = {'lottfarming:berries_seed'}, rarity = 2},
  71. { items = {'lottfarming:berries_seed'}, rarity = 5},
  72. { items = {'lottfarming:berries'} },
  73. { items = {'lottfarming:berries'}, rarity = 2 },
  74. { items = {'lottfarming:berries'}, rarity = 5 }
  75. }
  76. },
  77. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  78. sounds = default.node_sound_leaves_defaults(),
  79. })
  80. minetest.register_craftitem("lottfarming:berries", {
  81. description = "Berries",
  82. inventory_image = "lottfarming_berries.png",
  83. on_use = minetest.item_eat(1),
  84. })
  85. farming:add_plant("lottfarming:berries_4", {"lottfarming:berries_1", "lottfarming:berries_2", "lottfarming:berries_3"}, 50, 20, 34)