From 15debf9df16b7e064c61480015aeb00f0fe1b3ff Mon Sep 17 00:00:00 2001 From: TheWhiteWolves Date: Wed, 19 Aug 2015 00:09:07 +0100 Subject: [PATCH] Fix compatibility with TCon HUD Render Fixes #1273 --- .../client/core/handler/HUDHandler.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java index aeeb156f2..830d32c77 100644 --- a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java @@ -69,7 +69,24 @@ public final class HUDHandler { public static final ResourceLocation manaBar = new ResourceLocation(LibResources.GUI_MANA_HUD); @SubscribeEvent - public void onDrawScreen(RenderGameOverlayEvent.Post event) { + public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) { + Minecraft mc = Minecraft.getMinecraft(); + Profiler profiler = mc.mcProfiler; + + if(event.type == ElementType.HEALTH) { + profiler.startSection("botania-hud"); + ItemStack amulet = PlayerHandler.getPlayerBaubles(mc.thePlayer).getStackInSlot(0); + if(amulet != null && amulet.getItem() == ModItems.flightTiara) { + profiler.startSection("flugelTiara"); + ItemFlightTiara.renderHUD(event.resolution, mc.thePlayer, amulet); + profiler.endSection(); + } + profiler.endSection(); + } + } + + @SubscribeEvent + public void onDrawScreenPost(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; ItemStack equippedStack = mc.thePlayer.getCurrentEquippedItem(); @@ -174,15 +191,6 @@ public final class HUDHandler { profiler.endSection(); GL11.glColor4f(1F, 1F, 1F, 1F); - } else if(event.type == ElementType.HEALTH) { - profiler.startSection("botania-hud"); - ItemStack amulet = PlayerHandler.getPlayerBaubles(mc.thePlayer).getStackInSlot(0); - if(amulet != null && amulet.getItem() == ModItems.flightTiara) { - profiler.startSection("flugelTiara"); - ItemFlightTiara.renderHUD(event.resolution, mc.thePlayer, amulet); - profiler.endSection(); - } - profiler.endSection(); } }