When enchantment sorting is disabled, appendEnchantmentsHead() which is responsible for filling cachedTooltipIcons is skipped and thus the icons don't render.
The fix is to simply remove the condition
if (ModConfig.configsFirstLoaded && ModConfig.sortingSetting != ModConfig.SortingSetting.DISABLED) {
(The first condition should always be true since the config is loaded on title screen.)
I also looked at the tooltip render code again, I'm now much more confident it is actually correct.
Instead of applying inverse operations, push()/pop() should be used.
In general, render operations should look like
matrices.push()
modify matrices
do the actual rendering
matrices.pop()
If matrices is RenderSystem.getModelViewStack() then do RenderSystem.applyModelViewMatrix(); after modifying matrices and matrices.pop().
When enchantment sorting is disabled,
appendEnchantmentsHead()
which is responsible for fillingcachedTooltipIcons
is skipped and thus the icons don't render.The fix is to simply remove the condition
if (ModConfig.configsFirstLoaded && ModConfig.sortingSetting != ModConfig.SortingSetting.DISABLED) {
(The first condition should always be true since the config is loaded on title screen.)I also looked at the tooltip render code again, I'm now much more confident it is actually correct. Instead of applying inverse operations,
push()
/pop()
should be used.In general, render operations should look like
matrices.push()
matrices
matrices.pop()
If
matrices
isRenderSystem.getModelViewStack()
then doRenderSystem.applyModelViewMatrix();
after modifyingmatrices
andmatrices.pop()
.