NotifyProxyClient is trying to construct an instance of FontRendererFancy on each "message" being rendered
3TUSK opened this issue ยท 0 comments
Synopsis
For each in-world message being rendered through NotifyProxyClient
, it will try wrap the global FontRenderer
(obtained from Minecraft.getMinecraft().fontRenderer
) into a FontRendererFancy
and use the wrapped version, which cause FPS lag due to frequent I/O operations.
Reproduction
- Having Charset 0.5.5.7 with the barrel module enabled at least.
- Place a barrel on ground. Any barrel will work.
- Right click barrel with empty hand so that the in-world message "Empty" is displayed.
- Notice the significant FPS drop.
Altrenative reproduction method:
- Having Charset 0.5.5.7 with Simple Logic installed.
- Place a Timer on ground.
- Right click the Timer without sneaking. An in-world message that indicates its current time interval setting will pop up.
- Notice the significant FPS drop.
Analysis
Constructing FontRendererFancy
will cause it reading default char. width data as well as other data from the current resource pack repository. Constructing it on each time in-world message being rendered leads to nothing but lag. This can be seen from the following sampling data (recorded using JVisualVM):
Proposed Fix
Keep a global FontRendererFancy
somewhere, or use Minecraft.getMinecraft().fontRenderer
directly if there is no special need.