Make item name rendering and status bar rendering respect additional gui overlays being rendered by mods (#9648)

This commit is contained in:
Sara Freimer authored and GitHub committed 2023-07-14 10:17:43 -07:00
1 parent b7131824f0
commit 5271ef79fe
4 files changed
+18 -4

No files matched your search

@@ -485,8 +485,12 @@ public class ForgeGui extends Gui
if (opacity > 8)
{
//Include a shift based on the bar height plus the difference between the height that renderSelectedItemName
// renders at (59) and the height that the overlay/status bar renders at (68) by default
int yShift = Math.max(leftHeight, rightHeight) + (68 - 59);
guiGraphics.pose().pushPose();
guiGraphics.pose().translate(width / 2D, height - 68, 0.0D);
//If y shift is smaller less than the default y level, just render it at the base y level
guiGraphics.pose().translate(width / 2D, height - Math.max(yShift, 68), 0.0D);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
int color = (animateOverlayMessageColor ? Mth.hsvToRgb(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE);
@@ -144,7 +144,7 @@ public enum VanillaGuiOverlay
gui.setupOverlayRenderState(true, false);
if (gui.getMinecraft().gameMode.getPlayerMode() != GameType.SPECTATOR)
{
gui.renderSelectedItemName(guiGraphics);
gui.renderSelectedItemName(guiGraphics, Math.max(gui.leftHeight, gui.rightHeight));
}
else if (gui.getMinecraft().player.isSpectator())
{