Issue with other mods relying on GuiIngameForge.right_height
maxanier opened this issue ยท 4 comments
Hello,
I'm the author of the mod Vampirism and recently had a report about an compat issue with this RPG-Hud mod (TeamLapen/Vampirism#220).
Vampirism replaces the food bar with a blood bar by canceling the food render event and rendering the blood bar very similar then.
Canceling still works fine with your mod, however the rendering itself does not work correctly.
The placement of the GUI element relies on GuiIngameFore.right_height
(static) which is used by Vanilla to make sure food, air bubbles and mount health are not rendered on each other if all are displayed.
int top = event.getResolution().getScaledHeight() - GuiIngameForge.right_height;
GuiIngameForge.right_height += 10;
The RPG-HUD does not use this (which is probably fine), but it also never resets it as vanilla (GuiIngameForge#renderGameOverlay
) does. So it is increased to insane values.
Simplest solution would be to just do the same and reset GuiIngameForge.right_height
(and GuiIngameForge.left_height
) to 39 during each overriden #renderGameOverlay
Thx
eh. you're right. WHy did I make a new one. the normal one is public static o.o
Let's eh. not talk about this ever again.
Will be fixed with the upcoming bugfix version.
Thanks for informing me. I'll look into it!
So far to my testing it doesnt behave much differently than vanilla does. with each call of GuiIngameRPGHud#renderGameOverlay it gets reset to 39.
(as seen in the file here: link)
Which is unchanged from the vanilla version (the overriden version simply replaces the render calls but keeps everything else the same). The reset also is done for every of the minecraft versions (95% of the code is the same for each version). I'll try testing it with vampirism installed but so far the highets value i've seen is 59.
Not completely sure, but it looks like you are reseting the right_height of your own class GuiIngameRPGHud
. Because this is a static field, this does not affect the static field in the vanilla GuiIngameForge
class.
Since Vampirism does not know about your custom class, it can only access the static field GuiIngameForge
which is not being reset.