Skip to content

Commit

Permalink
Updated the render hook to be rendered before
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoxkk0 committed Sep 18, 2024
1 parent ced221c commit 784aa46
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ private void drawBossBar(TextureManager textureManager, int x, int y, BossBarCom

GL11.glColor4f(RED, GREEN, BLUE, 1F);

minecraft.mcProfiler.startSection("bars");

textureManager.bindTexture(BARS_TEXTURES);

drawTexturedModalRect(x, y, 0, 0, BAR_SIZE, BAR_SEGMENT_HEIGHT);
Expand All @@ -115,6 +117,10 @@ private void drawBossBar(TextureManager textureManager, int x, int y, BossBarCom
drawTexturedModalRect(x, y, 0, DECORATION_GAP + (bar.getType().ordinal() - 1) * BAR_SEGMENT_HEIGHT * 2, BAR_SIZE, BAR_SEGMENT_HEIGHT);
}

minecraft.mcProfiler.endSection();

minecraft.mcProfiler.startSection("barsValues");

int percentage = (int) (bar.getPercentage() * BAR_SIZE);

if (percentage > 0) {
Expand All @@ -127,13 +133,15 @@ private void drawBossBar(TextureManager textureManager, int x, int y, BossBarCom

}

minecraft.mcProfiler.endSection();

GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glPopMatrix();
minecraft.mcProfiler.endSection();
}

@SubscribeEvent
public void onRenderGui(RenderGameOverlayEvent.Post event) {
public void onRenderGui(RenderGameOverlayEvent.Pre event) {
if (event.type == RenderGameOverlayEvent.ElementType.EXPERIENCE)
instance.render(event.resolution);
}
Expand Down

0 comments on commit 784aa46

Please sign in to comment.