Sk1erLLC / Patcher

A Forge mod full of Vanilla bug fixes, Quality of Life improvements, and performance enhancements.
Other
232 stars 60 forks source link

fix: resolve font renderer issues #17

Closed DJtheRedstoner closed 3 years ago

DJtheRedstoner commented 3 years ago

Some notes on the fix for #7: This fixes situations like §mTest, §6Test1 §r§mTest2 already works. The reason this is necessary is because FontRenderer#renderString sets the color based on the passed color, then calls FontRenderer#renderStringAtPos (which patcher hooks). However patcher does not update the lastColor/Alpha of a CachedString until a color code or reset code is hit. This means that the strikethrough in the first case above does render, but with alpha 0 (completely transparent). By initializing the lastColor/Alpha we resolve this issue.