@Override
  public void renderEquippedItems(
      IRenderAccess renderer, EntityLiving par1EntityLiving, float par2) {
    ItemStack itemstack = new ItemStack(Block.pumpkin, 1);

    ModelSnowMan snowmanModel = (ModelSnowMan) renderer.getMainModel();

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock) {
      GL11.glPushMatrix();
      snowmanModel.head.postRender(0.0625F);

      IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
      boolean is3D =
          (customRenderer != null
              && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

      if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) {
        float f1 = 0.625F;
        GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
        GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f1, -f1, f1);
      }

      renderer.getRenderManager().itemRenderer.renderItem(par1EntityLiving, itemstack, 0);
      GL11.glPopMatrix();
    }
  }
  public static boolean renderEntityItem(
      EntityItem entity,
      ItemStack item,
      float bobing,
      float rotation,
      Random random,
      TextureManager engine,
      RenderBlocks renderBlocks) {
    IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY);
    if (customRenderer == null) {
      return false;
    }

    if (customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_ROTATION)) {
      GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
    }
    if (!customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_BOBBING)) {
      GL11.glTranslatef(0.0F, -bobing, 0.0F);
    }
    boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);

    engine.func_110577_a(
        item.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
    Block block = (item.itemID < Block.blocksList.length ? Block.blocksList[item.itemID] : null);
    if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))) {
      int renderType = (block != null ? block.getRenderType() : 1);
      float scale =
          (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2
              ? 0.5F
              : 0.25F);

      if (RenderItem.renderInFrame) {
        GL11.glScalef(1.25F, 1.25F, 1.25F);
        GL11.glTranslatef(0.0F, 0.05F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
      }

      GL11.glScalef(scale, scale, scale);

      int size = item.stackSize;
      int count = (size > 40 ? 5 : (size > 20 ? 4 : (size > 5 ? 3 : (size > 1 ? 2 : 1))));

      for (int j = 0; j < count; j++) {
        GL11.glPushMatrix();
        if (j > 0) {
          GL11.glTranslatef(
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale,
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale,
              ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale);
        }
        customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
        GL11.glPopMatrix();
      }
    } else {
      GL11.glScalef(0.5F, 0.5F, 0.5F);
      customRenderer.renderItem(ENTITY, item, renderBlocks, entity);
    }
    return true;
  }
  protected void renderEquippedItems(EntityLiving var1, float var2) {
    super.renderEquippedItems(var1, var2);
    ItemStack var3 = var1.getHeldItem();

    if (var3 != null) {
      GL11.glPushMatrix();
      this.modelBipedMain.bipedRightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
      IItemRenderer var5 =
          MinecraftForgeClient.getItemRenderer(var3, IItemRenderer.ItemRenderType.EQUIPPED);
      boolean var6 =
          var5 != null
              && var5.shouldUseRenderHelper(
                  IItemRenderer.ItemRenderType.EQUIPPED,
                  var3,
                  IItemRenderer.ItemRendererHelper.BLOCK_3D);
      float var4;

      if (var3.getItem() instanceof ItemBlock
          && (var6 || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))) {
        var4 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        var4 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(var4, -var4, var4);
      } else if (Item.itemsList[var3.itemID].isFull3D()) {
        var4 = 0.625F;
        GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
        GL11.glScalef(var4, -var4, var4);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        var4 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(var4, var4, var4);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
      }

      this.renderManager.itemRenderer.renderItem(var1, var3, 0);

      if (var3.getItem().requiresMultipleRenderPasses()) {
        for (int var7 = 1; var7 < var3.getItem().getRenderPasses(var3.getItemDamage()); ++var7) {
          this.renderManager.itemRenderer.renderItem(var1, var3, var7);
        }
      }

      GL11.glPopMatrix();
    }
  }
Example #4
0
 @Override
 protected void renderEquippedItems(EntityLivingBase entityliving, float f) {
   if (entityliving instanceof zei_EntityWorker) {
     zei_EntityWorker ea = ((zei_EntityWorker) entityliving);
     int ii = ea.getInventoryType();
     if (ii > 0) {
       ItemStack itemstack = new ItemStack(ii, 1, ea.getInventoryDamage());
       // if(itemstack.itemID!=0){
       GL11.glPushMatrix();
       model.light.postRender(0.0625F);
       GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
       if (itemstack.itemID < 256
           && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) {
         float f1 = 0.3F;
         GL11.glTranslatef(0.0875F, -0.9F, -0.1F); // GL11.glTranslatef(0.0F,
         // -0.1875F,
         // -0.3125F);
         // f1 *= 0.75F;
         // GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F);
         GL11.glScalef(f1, -f1, f1);
       } else if (Item.itemsList[itemstack.itemID].isFull3D()) {
         float f2 = 0.3125F;
         GL11.glTranslatef(0.1F, -0.8F, 0.4F);
         GL11.glScalef(f2, -f2, f2);
         GL11.glRotatef(-80F, 1.0F, 0.0F, 0.0F);
         GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
       } else {
         /*
          * float f3 = 0.375F; GL11.glTranslatef(0.25F, -0.1875F,
          * -0.1875F); GL11.glScalef(f3, f3, f3);
          */
         float f2 = 0.3125F;
         GL11.glTranslatef(0.1F, -0.8F, 0.4F);
         GL11.glScalef(f2, -f2, f2);
         GL11.glRotatef(-80F, 1.0F, 0.0F, 0.0F);
         GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
         /*
          * GL11.glRotatef(60F, 0.0F, 0.0F, 1.0F);
          * GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
          * GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
          */
       }
       renderManager.itemRenderer.renderItem(entityliving, itemstack, 0);
       GL11.glPopMatrix();
     }
   }
 }
  private void renderItemStack(TileEntity tileEntity, ItemStack itemStack) {

    GL11.glTranslated(0.5, 0, 0.5);
    if (itemStack.getItem() instanceof ItemBlock
        && RenderBlocks.renderItemIn3d(
            Block.getBlockFromItem(itemStack.getItem()).getRenderType())) {
      GL11.glTranslated(0, 0.55, 0);
    } else {
      GL11.glTranslated(0, 0.5, -(0.0625F * 3.65));
      GL11.glRotated(90, 1, 0, 0);
    }

    forceGraphics(true);

    EntityItem item = new EntityItem(tileEntity.getWorldObj(), 0, 0, 0, itemStack);
    item.getEntityItem().stackSize = 1;
    item.hoverStart = 0;

    RenderManager.instance.renderEntityWithPosYaw(item, 0, 0, 0, 0, 0);

    resetGraphics();
  }
  protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) {
    float var3 = 1.0F;
    GL11.glColor3f(var3, var3, var3);
    super.renderEquippedItems(par1EntityLiving, par2);
    ItemStack var4 = par1EntityLiving.getHeldItem();
    if (var4 != null) {
      GL11.glPushMatrix();
      ModelGaiaNaga.rightarmlower.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
      IItemRenderer customRenderer =
          MinecraftForgeClient.getItemRenderer(var4, ItemRenderType.EQUIPPED);
      boolean is3D =
          customRenderer != null
              && customRenderer.shouldUseRenderHelper(
                  ItemRenderType.EQUIPPED, var4, ItemRendererHelper.BLOCK_3D);
      float x;
      if (var4.getItem() instanceof ItemBlock
          && (is3D
              || (Block.getBlockFromItem(var4.getItem()) != null
                  && RenderBlocks.renderItemIn3d(
                      Block.getBlockFromItem(var4.getItem()).getRenderType())))) {
        x = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        x *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(x, -x, x);
      } else if (var4.getItem() == Items.bow) {
        x = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(x, -x, x);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else if (var4.getItem().isFull3D()) {
        x = 0.625F;
        if (var4.getItem().shouldRotateAroundWhenRendering()) {
          GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
          GL11.glTranslatef(0.0F, -0.125F, 0.0F);
        }

        this.func_82422_c();
        GL11.glScalef(x, -x, x);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        x = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(x, x, x);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
      }

      this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 0);
      if (var4.getItem().requiresMultipleRenderPasses()) {
        for (int var8 = 1; var8 < var4.getItem().getRenderPasses(var4.getItemDamage()); ++var8) {
          this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, var8);
        }
      }

      GL11.glPopMatrix();
    }
  }
  public void renderItemStack(ItemStack stack) {
    if (stack != null) {
      Minecraft mc = Minecraft.getMinecraft();
      mc.renderEngine.bindTexture(
          stack.getItem() instanceof ItemBlock
              ? TextureMap.locationBlocksTexture
              : TextureMap.locationItemsTexture);

      float s = 0.25F;
      GL11.glScalef(s, s, s);
      GL11.glScalef(2F, 2F, 2F);
      if (!ForgeHooksClient.renderEntityItem(
          new EntityItem(
              brewery.getWorldObj(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack),
          stack,
          0F,
          0F,
          brewery.getWorldObj().rand,
          mc.renderEngine,
          RenderBlocks.getInstance(),
          1)) {
        GL11.glScalef(0.5F, 0.5F, 0.5F);
        if (stack.getItem() instanceof ItemBlock
            && RenderBlocks.renderItemIn3d(
                Block.getBlockFromItem(stack.getItem()).getRenderType())) {
          GL11.glScalef(0.5F, 0.5F, 0.5F);
          GL11.glTranslatef(1F, 1.1F, 0F);
          GL11.glPushMatrix();
          RenderBlocks.getInstance()
              .renderBlockAsItem(
                  Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F);
          GL11.glPopMatrix();
          GL11.glTranslatef(-1F, -1.1F, 0F);
          GL11.glScalef(2F, 2F, 2F);
        } else {
          int renderPass = 0;
          do {
            IIcon icon = stack.getItem().getIcon(stack, renderPass);
            if (icon != null) {
              Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
              GL11.glColor3ub(
                  (byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
              float f = icon.getMinU();
              float f1 = icon.getMaxU();
              float f2 = icon.getMinV();
              float f3 = icon.getMaxV();

              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  f1,
                  f2,
                  f,
                  f3,
                  icon.getIconWidth(),
                  icon.getIconHeight(),
                  1F / 16F);
              GL11.glColor3f(1F, 1F, 1F);
            }
            renderPass++;
          } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
        }
      }
      GL11.glScalef(1F / s, 1F / s, 1F / s);

      Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    }
  }
  // 独自の手に持ったアイテムの描画(ModelBiped)
  private void renderEquippedItems(EntityLiving par1Entity, float par2) {
    GL11.glColor3f(1.0F, 1.0F, 1.0F);
    super.renderEquippedItems(par1Entity, par2);
    ItemStack itemstack = par1Entity.getHeldItem();
    ItemStack itemstack1 = par1Entity.func_130225_q(3);
    Item item;
    float f1;

    if (itemstack1 != null) {
      GL11.glPushMatrix();
      // this.modelBipedMain.bipedHead.postRender( 0.0625F );
      item = itemstack1.getItem();

      IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
      boolean is3D =
          (customRenderer != null
              && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));

      if (item instanceof ItemBlock) {
        if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) {
          f1 = 0.625F;
          GL11.glTranslatef(0.0F, -0.25F, 0.0F);
          GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glScalef(f1, -f1, -f1);
        }

        this.renderManager.itemRenderer.renderItem(par1Entity, itemstack1, 0);
      } else if (item == Items.skull) {
        f1 = 1.0625F;
        GL11.glScalef(f1, -f1, -f1);
        GameProfile gameprofile = null;

        if (itemstack1.hasTagCompound()) {
          NBTTagCompound nbttagcompound = itemstack1.getTagCompound();

          if (nbttagcompound.hasKey("SkullOwner", 10)) {
            gameprofile = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("SkullOwner"));
          } else if (nbttagcompound.hasKey("SkullOwner", 8)
              && !StringUtils.isNullOrEmpty(nbttagcompound.getString("SkullOwner"))) {
            gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner"));
          }
        }

        TileEntitySkullRenderer.field_147536_b.func_152674_a(
            -0.5F, 0.0F, -0.5F, 1, 180.0F, itemstack1.getItemDamage(), gameprofile);
      }

      GL11.glPopMatrix();
    }

    if (itemstack != null && itemstack.getItem() != null) {
      item = itemstack.getItem();
      GL11.glPushMatrix();

      if (this.mainModel.isChild) {
        f1 = 0.5F;
        GL11.glTranslatef(0.0F, 0.625F, 0.0F);
        GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F);
        GL11.glScalef(f1, f1, f1);
      }

      this.modelLivingChestMain.rightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);

      IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
      boolean is3D =
          (customRenderer != null
              && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

      if (item instanceof ItemBlock
          && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) {
        f1 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        f1 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-f1, -f1, f1);
      } else if (item == Items.bow) {
        f1 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f1, -f1, f1);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else if (item.isFull3D()) {
        f1 = 0.625F;

        if (item.shouldRotateAroundWhenRendering()) {
          GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
          GL11.glTranslatef(0.0F, -0.125F, 0.0F);
        }

        this.func_82422_c();
        GL11.glScalef(f1, -f1, f1);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        f1 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(f1, f1, f1);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
      }

      float f2;
      float f3;
      int i;

      if (itemstack.getItem().requiresMultipleRenderPasses()) {
        for (i = 0; i < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++i) {
          int j = itemstack.getItem().getColorFromItemStack(itemstack, i);
          f2 = (j >> 16 & 255) / 255.0F;
          f3 = (j >> 8 & 255) / 255.0F;
          float f4 = (j & 255) / 255.0F;
          GL11.glColor4f(f2, f3, f4, 1.0F);
          this.renderManager.itemRenderer.renderItem(par1Entity, itemstack, i);
        }
      } else {
        i = itemstack.getItem().getColorFromItemStack(itemstack, 0);
        float f5 = (i >> 16 & 255) / 255.0F;
        f2 = (i >> 8 & 255) / 255.0F;
        f3 = (i & 255) / 255.0F;
        GL11.glColor4f(f5, f2, f3, 1.0F);
        this.renderManager.itemRenderer.renderItem(par1Entity, itemstack, 0);
      }

      GL11.glPopMatrix();
    }
  }
  public static void renderItem(EntityLivingBase entity, ItemStack itemStack, int renderPass) {
    TextureManager texturemanager = FMLClientHandler.instance().getClient().getTextureManager();
    Item item = itemStack.getItem();
    Block block = Block.getBlockFromItem(item);

    GL11.glPushMatrix();
    if (itemStack.getItemSpriteNumber() == 0
        && item instanceof ItemBlock
        && RenderBlocks.renderItemIn3d(block.getRenderType())) {
      texturemanager.bindTexture(texturemanager.getResourceLocation(0));

      if (itemStack != null && block != null && block.getRenderBlockPass() != 0) {
        GL11.glDepthMask(false);
        RenderHelper.BLOCK_RENDERER.renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F);
        GL11.glDepthMask(true);
      } else {
        RenderHelper.BLOCK_RENDERER.renderBlockAsItem(block, itemStack.getItemDamage(), 1.0F);
      }
    } else {
      IIcon iicon = entity.getItemIcon(itemStack, renderPass);
      if (iicon == null) {
        GL11.glPopMatrix();
        return;
      }

      texturemanager.bindTexture(
          texturemanager.getResourceLocation(itemStack.getItemSpriteNumber()));
      TextureUtil.func_152777_a(false, false, 1.0F);
      Tessellator tessellator = Tessellator.instance;
      float minU = iicon.getMinU();
      float maxU = iicon.getMaxU();
      float minV = iicon.getMinV();
      float maxV = iicon.getMaxV();
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glTranslatef(0.0F, -0.3F, 0.0F);
      GL11.glScalef(1.5F, 1.5F, 1.5F);
      GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
      ItemRenderer.renderItemIn2D(
          tessellator,
          maxU,
          minV,
          minU,
          maxV,
          iicon.getIconWidth(),
          iicon.getIconHeight(),
          0.0625F);

      if (itemStack.hasEffect(renderPass)) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        texturemanager.bindTexture(RenderHelper.RES_ITEM_GLINT);
        GL11.glEnable(GL11.GL_BLEND);
        OpenGlHelper.glBlendFunc(768, 1, 1, 0);
        GL11.glColor4f(0.38F, 0.19F, 0.608F, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);

        GL11.glPushMatrix();
        GL11.glScalef(0.125F, 0.125F, 0.125F);
        float animOffset = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F;
        GL11.glTranslatef(animOffset, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
        GL11.glPopMatrix();

        GL11.glPushMatrix();
        GL11.glScalef(0.125F, 0.125F, 0.125F);
        animOffset = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F;
        GL11.glTranslatef(-animOffset, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
        GL11.glPopMatrix();

        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
      }

      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      texturemanager.bindTexture(
          texturemanager.getResourceLocation(itemStack.getItemSpriteNumber()));
      TextureUtil.func_147945_b();
    }
    if (itemStack != null && block != null && block.getRenderBlockPass() != 0) {
      GL11.glDisable(GL11.GL_BLEND);
    }
    GL11.glPopMatrix();
  }
  protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) {
    float f1 = 1.0F;
    GL11.glColor3f(f1, f1, f1);
    super.renderEquippedItems(par1EntityLiving, par2);
    ItemStack itemstack = par1EntityLiving.getHeldItem();
    ItemStack itemstack1 = par1EntityLiving.getCurrentArmor(3);
    float f2;

    if (itemstack1 != null) {
      GL11.glPushMatrix();
      this.modelBipedMain.bipedHead.postRender(0.0625F);

      IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
      boolean is3D =
          (customRenderer != null
              && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));

      if (itemstack1.getItem() instanceof ItemBlock) {
        if (is3D
            || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) {
          f2 = 0.625F;
          GL11.glTranslatef(0.0F, -0.25F, 0.0F);
          GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glScalef(f2, -f2, -f2);
        }

        this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack1, 0);
      } else if (itemstack1.getItem().itemID == Item.skull.itemID) {
        f2 = 1.0625F;
        GL11.glScalef(f2, -f2, -f2);
        String s = "";

        if (itemstack1.hasTagCompound() && itemstack1.getTagCompound().hasKey("SkullOwner")) {
          s = itemstack1.getTagCompound().getString("SkullOwner");
        }

        TileEntitySkullRenderer.skullRenderer.func_82393_a(
            -0.5F, 0.0F, -0.5F, 1, 180.0F, itemstack1.getItemDamage(), s);
      }

      GL11.glPopMatrix();
    }

    if (itemstack != null) {
      GL11.glPushMatrix();

      if (this.mainModel.isChild) {
        f2 = 0.5F;
        GL11.glTranslatef(0.0F, 0.625F, 0.0F);
        GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F);
        GL11.glScalef(f2, f2, f2);
      }

      this.modelBipedMain.bipedRightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);

      IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
      boolean is3D =
          (customRenderer != null
              && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

      if (itemstack.getItem() instanceof ItemBlock
          && (is3D
              || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))) {
        f2 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        f2 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-f2, -f2, f2);
      } else if (itemstack.itemID == Item.bow.itemID) {
        f2 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f2, -f2, f2);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else if (Item.itemsList[itemstack.itemID].isFull3D()) {
        f2 = 0.625F;

        if (Item.itemsList[itemstack.itemID].shouldRotateAroundWhenRendering()) {
          GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
          GL11.glTranslatef(0.0F, -0.125F, 0.0F);
        }

        this.func_82422_c();
        GL11.glScalef(f2, -f2, f2);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        f2 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(f2, f2, f2);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
      }

      this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, 0);

      if (itemstack.getItem().requiresMultipleRenderPasses()) {
        for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) {
          this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, x);
        }
      }

      GL11.glPopMatrix();
    }
  }