Make BlockSapling tick logic more efficient #300
Closed
bruberu
started this conversation in
Tweak Suggestions
Replies: 1 comment 2 replies
-
Closed with 09c43e4 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While looking through BlockSapling's code, I noticed this function:
Looking further, I noticed that isAreaLoaded is an O(n^2) algorithm, which presumably would take up a decent amount of tick time if enough saplings were placed down (e.g. in a skyblock pack). As such, UniversalTweaks could move the random check just before the isAreaLoaded call (not before the super call though, since that makes sure the sapling is still on the ground). In fact, this mod could also create a configuration to replace the magic number 7 here, allowing pack creators to speed up sapling growth if they so desire.
Beta Was this translation helpful? Give feedback.
All reactions