Armor Bar draws over extra hearts from Health Boost
juliand665 opened this issue ยท 13 comments
Vanilla has a health boost effect which gives you extra hearts (e.g. from the enchanted golden apple). While you seem to handle absorption correctly, when health boost hearts remain without absorption hearts, the armor bar is not moved up as it should be. This also causes incompatibility with SoL: Carrot since we increase the max health. Here's what it looks like after /effect give @s minecraft:health_boost 3
:
I'm sorry to report this is definitely still happening in 3.0.0aโฆ I could send a screenshot but it'd be identical. Here's the person who initially reported the issue re-reporting it, too.
Also, huh, looks like I can't reopen the issue? I always thought that was possible.
I see; you can't exactly check how the hearts are being rendered lol
Perhaps you could make that option true by default and force it to false when one of a list of mods making the health bar 1-high is active (e.g. colorful health bar or your very own classic bars)?
I tried that, it quickly because a clusterfuck, so instead I default it to false because 99% of people have something that alters the hearts, *cough Mantle, so that it can be manually edited in case of mods I didn't account for.
Interesting though; how does mantle avoid vanilla rendering the armor bar higher and can't you somehow hook into the same place to take over that offset?
this is what they do https://github.com/SlimeKnights/Mantle/blob/1.14/src/main/java/slimeknights/mantle/client/ExtraHeartRenderHandler.java#L99
I do a similar thing here
https://github.com/Tfarcenim/OverloadedArmorBar/blob/1.14.x/src/main/java/locusway/overpoweredarmorbar/overlay/OverlayEventHandler.java#L70
Ah nice, so how come you can't just use ForgeIngameGui.left_height
to determine how high to draw?
Yet another thing I didn't know existed.
If it works that means less code, slightly faster rendering and one less config option to worry about
For what it's worth, I didn't know about it either until I looked at that part of Mantle's code you just posted to figure out how they actually manage the offset lol
I'd assume the vanilla armor bar is patched to use it though, no?