Open Kaiochao opened 7 years ago
Only real lack of efficiency I see there is that it's checking every second. That could end up being quite a lot of plants. It may not need to check so frequently.
Idea: Update crops once when their chunk is enabled (when a player comes nearby), setting their age to the time since the last season change (plus some random amount). No more looping over every crop in the world every second.
Crops near players should grow using a single (long) delay per crop.
In Farming.dm, all growing plants are added to a growth loop. The growth loop ticks once every second, looping over every plant added to the loop to make them check their growth. When a plant stops growing (fully-grown or wrong season or wrong z-level), it's removed from the growth loop, so only actively-growing plants are involved.
What more efficient ways are there?