init.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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="raspberries:plant_1", drop="raspberries:fruit"},
  16. {name="raspberries:plant_2", drop="raspberries:fruit"},
  17. {name="raspberries:plant_3", drop="raspberries:fruit"},
  18. {name="raspberries:plant_4", drop="raspberries:fruit"},
  19. {insert="raspberries:fruit", nodes={"raspberries:plant_1", "raspberries:plant_2", "raspberries:plant_3", "raspberries:plant_4"}},
  20. {name="pumpkin:plant_1", drop="pumpkin:slice"},
  21. {name="pumpkin:plant_2", drop="pumpkin:slice"},
  22. {name="pumpkin:plant_3", drop="pumpkin:slice"},
  23. {name="pumpkin:plant_4", drop="pumpkin:slice"},
  24. {name="pumpkin:plant_5", drop="pumpkin:slice"},
  25. {name="pumpkin:plant_6", drop="pumpkin:slice"},
  26. {name="pumpkin:plant_7", drop="pumpkin:slice"},
  27. {name="pumpkin:plant_8", drop="pumpkin:slice"},
  28. {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"}},
  29. }
  30. for k, v in ipairs(plants) do
  31. if v.name then
  32. -- Must update node drops BEFORE registering the flowerpot node.
  33. if v.drop then
  34. minetest.override_item(v.name, {
  35. flowerpot_drop = v.drop,
  36. })
  37. end
  38. -- Register the flowerpot node.
  39. if v.tilex then
  40. flowerpot.register_node(v.name, v.tilex)
  41. else
  42. flowerpot.register_node(v.name)
  43. end
  44. end
  45. if v.insert and v.nodes then
  46. minetest.override_item(v.insert, {
  47. flowerpot_insert = v.nodes,
  48. })
  49. end
  50. end