![Ore Growth](https://media.forgecdn.net/avatars/thumbnails/885/662/256/256/638321294520165143_animated.gif)
[1.19.2-] Random tick mixin checks recipe on every call
embeddedt opened this issue ยท 1 comments
When backporting from 1.20.1 to 1.19.2, it appears the injector that enables random ticking on ore blocks was moved into isRandomlyTicking
rather than initCache
. In a server profile, I noted that this is 1% of the total tick time, which seems like a lot for such a simple feature.
Possibly this could be cached manually on older versions? One approach could be to inject into initCache
and store a flag if the block has an ore growth recipe, and then have isRandomlyTicking
return true
if that flag is set. Checking the flag should be much faster than looking up the recipe.
Whoops, I do vaguely remember it being an issue that there was no isRandomlyTicking
flag I could change when porting to 1.19.2, but I guess I just mixed into isRandomlyTicking
and forgot about it ๐
It checking for a recipe every time a block is random ticked is definitely not ideal.
I have now changed it so it checks once in initCache
and then caches the value like you suggested.
Thank you for looking into and reporting the issue, I really appreciate all these improvements you submit for my mods! ๐