init.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. local plants = {
  2. {name="bluegrass:plant_1", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  3. {name="bluegrass:plant_2", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  4. {name="bluegrass:plant_3", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  5. {name="bluegrass:plant_4", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  6. {name="bluegrass:plant_5", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  7. {name="bluegrass:plant_6", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  8. {name="bluegrass:plant_7", drop="bluegrass:bluegrass", tilex="^[transformR180"},
  9. {insert="bluegrass:bluegrass", nodes={"bluegrass:plant_1", "bluegrass:plant_2", "bluegrass:plant_3", "bluegrass:plant_4", "bluegrass:plant_5", "bluegrass:plant_6", "bluegrass:plant_7"}},
  10. {name="blueberries:plant_1", drop="blueberries:fruit"},
  11. {name="blueberries:plant_2", drop="blueberries:fruit"},
  12. {name="blueberries:plant_3", drop="blueberries:fruit"},
  13. {name="blueberries:plant_4", drop="blueberries:fruit"},
  14. {insert="blueberries:fruit", nodes={"blueberries:plant_1", "blueberries:plant_2", "blueberries:plant_3", "blueberries:plant_4"}},
  15. {name="coffee_bush:plant_1", drop="coffee_bush:seeds"},
  16. {name="coffee_bush:plant_2", drop="coffee_bush:seeds"},
  17. {name="coffee_bush:plant_3", drop="coffee_bush:seeds"},
  18. {name="coffee_bush:plant_4", drop="coffee_bush:seeds"},
  19. {insert="coffee_bush:seeds", nodes={"coffee_bush:plant_1", "coffee_bush:plant_2", "coffee_bush:plant_3", "coffee_bush:plant_4"}},
  20. {insert="aloevera:aloe_slice", nodes={"aloevera:aloe_plant_01", "aloevera:aloe_plant_02", "aloevera:aloe_plant_03", "aloevera:aloe_plant_04"}},
  21. {name="raspberries:plant_1", drop="raspberries:fruit"},
  22. {name="raspberries:plant_2", drop="raspberries:fruit"},
  23. {name="raspberries:plant_3", drop="raspberries:fruit"},
  24. {name="raspberries:plant_4", drop="raspberries:fruit"},
  25. {insert="raspberries:fruit", nodes={"raspberries:plant_1", "raspberries:plant_2", "raspberries:plant_3", "raspberries:plant_4"}},
  26. {name="pumpkin:plant_1", drop="pumpkin:slice"},
  27. {name="pumpkin:plant_2", drop="pumpkin:slice"},
  28. {name="pumpkin:plant_3", drop="pumpkin:slice"},
  29. {name="pumpkin:plant_4", drop="pumpkin:slice"},
  30. {name="pumpkin:plant_5", drop="pumpkin:slice"},
  31. {name="pumpkin:plant_6", drop="pumpkin:slice"},
  32. {name="pumpkin:plant_7", drop="pumpkin:slice"},
  33. {name="pumpkin:plant_8", drop="pumpkin:slice"},
  34. {insert="pumpkin:slice", nodes={"pumpkin:plant_1", "pumpkin:plant_2", "pumpkin:plant_3", "pumpkin:plant_4", "pumpkin:plant_5", "pumpkin:plant_6", "pumpkin:plant_7", "pumpkin:plant_8"}},
  35. }
  36. for k, v in ipairs(plants) do
  37. if v.name then
  38. -- Must update node drops BEFORE registering the flowerpot node.
  39. if v.drop then
  40. minetest.override_item(v.name, {
  41. flowerpot_drop = v.drop,
  42. })
  43. end
  44. -- Register the flowerpot node.
  45. if v.tilex then
  46. flowerpot.register_node(v.name, v.tilex)
  47. else
  48. flowerpot.register_node(v.name)
  49. end
  50. end
  51. if v.insert and v.nodes then
  52. minetest.override_item(v.insert, {
  53. flowerpot_insert = v.nodes,
  54. })
  55. end
  56. end