FluidModelRenderer block state container churn
asiekierka opened this issue · 3 comments
Description of the Bug
The current FluidModelRenderer implementation creates an ExtendedBlockState container on every renderFluid call. This is incredibly sub-optimal - creating a new block state container is an expensive operation. To improve the situation, the ExtendedBlockState object should be cached, and the IExtendedBlockState grabbed from the cached ExtendedBlockState.
I don't really understand all the blockstate stuff, but maybe this is the fix you meant? I just made it static final.
This was a while ago...
I think I would have preferred it to be cached on first call, rather than on static initializer, but I think the renderer's static initializer won't be called before Blocks.WATER is initialized. Typically. The former would be safer IMO, but this is roughly what I meant.
Thank you!