Weird Text Bug in the 'overlay'?
TheMerricat opened this issue ยท 7 comments
Any idea what causes this? I've been using Valhelsia 6 for the past several months and I know I wasn't originally getting when I was first using the compass to look for a biome, but for some reason when I went to use it today the text from the compass looks like this.
I'm sure it's probably not directly this mod, since I don't think it's been updated on my end since the last time I've used it. But I have no idea what other mods could be futzing with this.
Seems like https://www.curseforge.com/minecraft/mc-mods/hud-compass is causing the same issue.
Hi, dev of Hud Compass here. This feels like an interaction caused by an outdated way of doing overlay renderers -- that is, drawing things in the RenderGuiOverlayEvent instead of using the overlay renderer feature I added to forge a couple years ago. A quick look at the code seems to indicate this is the case, since the code at https://github.com/MattCzyr/NaturesCompass/blob/master/src/main/java/com/chaosthedude/naturescompass/client/ClientEventHandler.java is drawing straight in the overlay event, and on top of that, it does so without any layer check so it is drawing multiple times (once for each game overlay layer). This means the issue is there even when it doesn't appear to be, but it was only discovered because of this interaction causing one of the layers to be shifted out of position.
For the less issue-prone way, it would be best to register an overlay renderer (a class that extends IGuiOverlay) like I do here: https://github.com/gigaherz/HudCompass/blob/2e075ff0f6b5cac576849a4422c3bd97e7e85626/src/main/java/dev/gigaherz/hudcompass/client/HudOverlay.java#L60-L64
Edited to add: If changing over to an overlay renderer is not wanted, the simpler solution would be to add a render check
like if(event.getType() != RenderGameOverlayEvent.ElementType.ALL) return;
to ensure it only runs once.
@gigaherz Thanks, you're right, that code to render the overlay has been around forever, didn't realize there was a newer way to do it. I swapped this out for an overlay renderer and this seems to have fixed the issue. Should be fixed in version 1.11.5.
Might be related to #163. Do you have Advanced Compass installed? That mod seems to do something weird with its rendering which duplicates the Nature's Compass HUD. There's been an issue open about it on their issue tracker for some time now.
Sorry for the delayed response. I'm actually using https://www.curseforge.com/minecraft/modpacks/valhelsia-6 - and reviewing the mods included it doesn't seem as if Advanced Compass is included in that, but I do know that it only started happening when I updated to the 6.0.0-beta_20 update. https://wiki.valhelsia.net/modpacks/valhelsia-6/changelog#6.0.0-beta_20-beta-update
Again, I doubt it's Natures Compass's problem but figured I'd add more data points to the conversation.
And less than 10 minutes after I reply I re-read the changelog that I linked to and realize I know exactly which mod is the issue.
Just launched without it enabled and the visual glitch goes away. It's https://www.curseforge.com/minecraft/mc-mods/raised just opened an issue on their side yurisuika/Raised#78 referencing this one.
Sorry for the bother.