StyledChat icon indicating copy to clipboard operation
StyledChat copied to clipboard

Fix flickering text rendering on scoreboard when calling getDisplayName() from off of the main thread.

Open Axionize opened this issue 9 months ago • 0 comments

This one took a long time to debug, but it fixes https://github.com/GrimAnticheat/Grim/issues/2047. Grim runs lots of async tasks and processing on the netty thread and still needs to check permissions which on fabric requires a CommandSourceStack, the creation of which for a player via fabricPlayer.getCommandSource() calls fabricPlayer.getDisplayName() which causes the issue.

This PR returns the cached value of getDisplayName() when called from off the main thread, since the existing code is already built upon only updating within every tick regardless this breaks no existing behavior.

Axionize avatar Mar 11 '25 11:03 Axionize