Search in sources :

Example 1 with IHUDInfoProvider

use of tonius.simplyjetpacks.item.IHUDInfoProvider in project SimplyJetpacks by Tonius.

the class HUDTickHandler method tickEnd.

private static void tickEnd() {
    if (mc.thePlayer != null) {
        if ((mc.currentScreen == null || Config.showHUDWhileChatting && mc.currentScreen instanceof GuiChat) && !mc.gameSettings.hideGUI && !mc.gameSettings.showDebugInfo) {
            ItemStack chestplate = mc.thePlayer.getCurrentArmor(2);
            if (chestplate != null && chestplate.getItem() instanceof IHUDInfoProvider) {
                IHUDInfoProvider provider = (IHUDInfoProvider) chestplate.getItem();
                List<String> info = new ArrayList<String>();
                provider.addHUDInfo(info, chestplate, Config.enableFuelHUD, Config.enableStateHUD);
                if (info.isEmpty()) {
                    return;
                }
                GL11.glPushMatrix();
                mc.entityRenderer.setupOverlayRendering();
                GL11.glScaled(Config.HUDScale, Config.HUDScale, 1.0D);
                int i = 0;
                for (String s : info) {
                    RenderUtils.drawStringAtHUDPosition(s, HUDPositions.values()[Config.HUDPosition], mc.fontRenderer, Config.HUDOffsetX, Config.HUDOffsetY, Config.HUDScale, 0xeeeeee, true, i);
                    i++;
                }
                GL11.glPopMatrix();
            }
        }
    }
}
Also used : IHUDInfoProvider(tonius.simplyjetpacks.item.IHUDInfoProvider) ArrayList(java.util.ArrayList) GuiChat(net.minecraft.client.gui.GuiChat) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ArrayList (java.util.ArrayList)1 GuiChat (net.minecraft.client.gui.GuiChat)1 ItemStack (net.minecraft.item.ItemStack)1 IHUDInfoProvider (tonius.simplyjetpacks.item.IHUDInfoProvider)1