private void RenderManaBar(int i, int j, FontRenderer fontRenderer) {

    int barWidth = i / 8;

    AMVector2 fatigue_hud = getShiftedVector(AMCore.config.getBurnoutHudPosition(), i, j);
    AMVector2 mana_hud = getShiftedVector(AMCore.config.getManaHudPosition(), i, j);

    float green = 0.5f;
    float blue = 1.0f;
    float red = 0.126f;

    ExtendedProperties props = ExtendedProperties.For(mc.thePlayer);

    // mana bar
    float mana = props.getCurrentMana();
    float bonusMana = props.getBonusCurrentMana();
    float maxMana = props.getMaxMana();

    float fatigueBarWidth = barWidth;
    float fatigue = props.getCurrentFatigue();
    float maxFatigue = props.getMaxFatigue();

    if (mana + bonusMana > maxMana) mana = maxMana;

    float progressScaled = (mana / (maxMana + 0.01f));

    if (AMCore.config.showHudBars()) {
      // handle flashing of mana bar
      float flashTimer = AMGuiHelper.instance.getFlashTimer(MANA_BAR_FLASH_SLOT);
      if (flashTimer > 0) {
        green = 0.0f;
        float redShift = 1.0f - red;

        float halfFlash = AMGuiHelper.instance.flashDuration / 2;

        if (flashTimer > halfFlash) {
          float pct = (flashTimer - halfFlash) / halfFlash;
          red += redShift - (redShift * pct);
        } else {
          float pct = flashTimer / halfFlash;
          red += (redShift * pct);
        }
        GL11.glColor3f(red, green, blue);
      } else {
        if (bonusMana > 0) GL11.glColor3f(0.2f, 0.9f, 0.6f);
      }

      ItemStack curItem = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
      if (curItem != null
          && (curItem.getItem() == ItemsCommonProxy.spell
              || curItem.getItem() == ItemsCommonProxy.spellBook
              || curItem.getItem() == ItemsCommonProxy.arcaneSpellbook)) {
        ItemStack spellStack =
            curItem.getItem() == ItemsCommonProxy.spell
                ? curItem
                : ((ItemSpellBook) curItem.getItem()).GetActiveItemStack(curItem);
        if (spellStack != null) {
          int[] parts = SpellUtils.instance.getShapeGroupParts(spellStack);
          int sx = mana_hud.iX - 2 * parts.length / 2;
          int sy = mana_hud.iY - 2 * parts.length / 2;
          for (int p : parts) {
            IIcon icon =
                SpellIconManager.instance.getIcon(
                    SkillManager.instance.getSkillName(SkillManager.instance.getSkill(p)));
            if (icon != null) {
              DrawIconAtXY(icon, "items", sx, sy, false);
              sx += 3;
              sy += 3;
            }
          }
        }
      }

      DrawPartialIconAtXY(
          AMGuiIcons.manaLevel,
          progressScaled,
          1,
          mana_hud.iX + 16,
          mana_hud.iY + 1f,
          (int) (barWidth * 0.97f),
          40,
          false);
      DrawIconAtXY(
          AMGuiIcons.manaBar, "items", mana_hud.iX + 15, mana_hud.iY + 3, barWidth, 50, false);

      GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

      progressScaled = (fatigue / (maxFatigue + 0.01f));
      DrawIconAtXY(
          AMGuiIcons.fatigueIcon, "items", fatigue_hud.iX + barWidth, fatigue_hud.iY, false);

      DrawPartialIconAtXY(
          AMGuiIcons.fatigueLevel,
          progressScaled,
          1,
          fatigue_hud.iX,
          fatigue_hud.iY + 3f,
          fatigueBarWidth,
          40,
          false);
      DrawIconAtXY(
          AMGuiIcons.fatigueBar, "items", fatigue_hud.iX, fatigue_hud.iY + 4, barWidth, 48, false);

      green = 0.5f;
      blue = 1.0f;
      red = 0.126f;
      // magic level
      int manaBarColor = Math.round(red * 255);
      manaBarColor = (manaBarColor << 8) + Math.round(green * 255);
      manaBarColor = (manaBarColor << 8) + Math.round(blue * 255);

      String magicLevel =
          (new StringBuilder())
              .append("")
              .append(ExtendedProperties.For(mc.thePlayer).getMagicLevel())
              .toString();
      AMVector2 magicLevelPos = getShiftedVector(AMCore.config.getLevelPosition(), i, j);
      magicLevelPos.iX -= Minecraft.getMinecraft().fontRenderer.getStringWidth(magicLevel) / 2;
      fontRenderer.drawStringWithShadow(
          magicLevel, magicLevelPos.iX, magicLevelPos.iY, manaBarColor);

      if (flashTimer > 0) {
        GL11.glColor3f(1.0f, 1.0f, 1.0f);
      }
    }

    if (AMCore.config.getShowNumerics()) {
      String manaStr =
          StatCollector.translateToLocal("am2.gui.mana")
              + ": "
              + (int) (mana + bonusMana)
              + "/"
              + (int) maxMana;
      String burnoutStr =
          StatCollector.translateToLocal("am2.gui.burnout")
              + ": "
              + (int) props.getCurrentFatigue()
              + "/"
              + (int) props.getMaxFatigue();
      AMVector2 manaNumericPos = getShiftedVector(AMCore.config.getManaNumericPosition(), i, j);
      AMVector2 burnoutNumericPos =
          getShiftedVector(AMCore.config.getBurnoutNumericPosition(), i, j);
      fontRenderer.drawString(
          manaStr, manaNumericPos.iX, manaNumericPos.iY, bonusMana > 0 ? 0xeae31c : 0x2080FF);
      fontRenderer.drawString(
          burnoutStr,
          burnoutNumericPos.iX + 25 - fontRenderer.getStringWidth(burnoutStr),
          burnoutNumericPos.iY,
          0xFF2020);
    }
  }