I have a custom IGuiOverly defined to show the players hydration levels. Preferably, I would like it to appear between the hunger level tracker and the air bubble tracker. Currently I have manually positioned it above hunger with the RenderSystem and the GuiGraphics.blit method and it is just being drawn on top of the air tracker if a player submerges themselves.
public static final IGuiOverlay HUD_THIRST = ((gui, guiGraphics, partialTick, screenWidth, screenHeight) -> {
int x = screenWidth / 2;
int y = screenHeight;
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
RenderSystem.setShaderTexture(0, EMPTY_THIRST);
for(int i = 0; i < 10; i++) {
guiGraphics.blit(EMPTY_THIRST, x + 8 + (i * 8), y -51, 0, 0, 13, 12,
13, 12);
}
RenderSystem.setShaderTexture(0, FILLED_THIRST);
for(int i = 0; i < 10; i++) {
if(ClientThirstData.get() > i) {
guiGraphics.blit(FILLED_THIRST, x + 8 + (i * 8), y -51, 0, 0, 13, 12,
13, 12);
} else {
break;
}
}
});
Is there a way to bump the air bubble tracker up a few few pixels or make my GUI overlay known to the vanilla classes to prevent overlapping?