Strange ABM problem again
In my nature mod, there is an ABM for trees growing and blossoming. You can see its code here: https://bitbucket.org/neko259/nature/src/92628d00968229c64b506438c3f321129dda66fd/nature/tree_growth.lua?at=default
It's intended to work on every 20th block of leaves in the area. But when I come to an area with trees, they grow infinitely up (well, not infinitely, just to the ABM distance), just like every new spawn block triggers the ABM on itself. So, it seems to work like this:
1. A leaf grows into a trunk.
2. The new trunk is surrounded by new leaves.
3. The upper new leaf grows into a new trunk, go to 1)
And so on. How can I prevent the newly grown nodes from growing again?
It's intended to work on every 20th block of leaves in the area. But when I come to an area with trees, they grow infinitely up (well, not infinitely, just to the ABM distance), just like every new spawn block triggers the ABM on itself. So, it seems to work like this:
1. A leaf grows into a trunk.
2. The new trunk is surrounded by new leaves.
3. The upper new leaf grows into a new trunk, go to 1)
And so on. How can I prevent the newly grown nodes from growing again?