grass.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. -- Override grasses to drop seeds
  2. if minetest.registered_nodes["default:grass_1"] then
  3. for i = 4, 5 do
  4. minetest.override_item("default:grass_" .. i, {
  5. drop = {
  6. max_items = 1,
  7. items = {
  8. {items = {"farming:seed_wheat"}, rarity = 5},
  9. {items = {"farming:seed_oat"},rarity = 5},
  10. {items = {"default:grass_1"}}
  11. }
  12. }
  13. })
  14. end
  15. end
  16. if minetest.registered_nodes["default:dry_grass_1"] then
  17. for i = 4, 5 do
  18. minetest.override_item("default:dry_grass_" .. i, {
  19. drop = {
  20. max_items = 1,
  21. items = {
  22. {items = {"farming:seed_barley"}, rarity = 5},
  23. {items = {"farming:seed_rye"}, rarity = 5},
  24. {items = {"default:dry_grass_1"}}
  25. }
  26. }
  27. })
  28. end
  29. end
  30. if minetest.registered_nodes["default:junglegrass"] then
  31. minetest.override_item("default:junglegrass", {
  32. drop = {
  33. max_items = 1,
  34. items = {
  35. {items = {"farming:seed_cotton"}, rarity = 8},
  36. {items = {"farming:seed_rice"}, rarity = 8},
  37. {items = {"default:junglegrass"}}
  38. }
  39. }
  40. })
  41. end
  42. if farming.mcl then
  43. minetest.override_item("mcl_flowers:tallgrass", {
  44. drop = {
  45. max_items = 1,
  46. items = {
  47. {items = {"mcl_farming:wheat_seeds"}, rarity = 5},
  48. {items = {"farming:seed_oat"},rarity = 5},
  49. {items = {"farming:seed_barley"}, rarity = 5},
  50. {items = {"farming:seed_rye"},rarity = 5},
  51. {items = {"farming:seed_cotton"}, rarity = 8},
  52. {items = {"farming:seed_rice"},rarity = 8}
  53. }
  54. }
  55. })
  56. end