Exemplo n.º 1
0
  public void renderItemInFirstPerson(float par1) {
    float var2 =
        this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1;
    EntityPlayerSP var3 = this.mc.thePlayer;
    float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * par1;
    GL11.glPushMatrix();
    GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(
        var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();
    float var6;
    float var7;
    if (var3 instanceof EntityPlayerSP) {
      EntityPlayerSP var5 = (EntityPlayerSP) var3;
      var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * par1;
      var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * par1;
      GL11.glRotatef((var3.rotationPitch - var6) * 0.1F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef((var3.rotationYaw - var7) * 0.1F, 0.0F, 1.0F, 0.0F);
    }

    ItemStack var14 = this.itemToRender;
    var6 =
        this.mc.theWorld.getLightBrightness(
            MathHelper.floor_double(var3.posX),
            MathHelper.floor_double(var3.posY),
            MathHelper.floor_double(var3.posZ));
    var6 = 1.0F;
    int var15 =
        this.mc.theWorld.getLightBrightnessForSkyBlocks(
            MathHelper.floor_double(var3.posX),
            MathHelper.floor_double(var3.posY),
            MathHelper.floor_double(var3.posZ),
            0);
    int var8 = var15 % 65536;
    int var9 = var15 / 65536;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) var8 / 1.0F, (float) var9 / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float var10;
    float var17;
    float var18;
    if (var14 != null) {
      var15 = Item.itemsList[var14.itemID].getColorFromDamage(var14.getItemDamage(), 0);
      var17 = (float) (var15 >> 16 & 255) / 255.0F;
      var18 = (float) (var15 >> 8 & 255) / 255.0F;
      var10 = (float) (var15 & 255) / 255.0F;
      GL11.glColor4f(var6 * var17, var6 * var18, var6 * var10, 1.0F);
    } else {
      GL11.glColor4f(var6, var6, var6, 1.0F);
    }

    float var11;
    float var13;
    if (var14 != null && var14.itemID == Item.map.shiftedIndex) {
      GL11.glPushMatrix();
      var7 = 0.8F;
      var17 = var3.getSwingProgress(par1);
      var18 = MathHelper.sin(var17 * (float) Math.PI);
      var10 = MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI);
      GL11.glTranslatef(
          -var10 * 0.4F,
          MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI * 2.0F) * 0.2F,
          -var18 * 0.2F);
      var17 = 1.0F - var4 / 45.0F + 0.1F;
      if (var17 < 0.0F) {
        var17 = 0.0F;
      }

      if (var17 > 1.0F) {
        var17 = 1.0F;
      }

      var17 = -MathHelper.cos(var17 * (float) Math.PI) * 0.5F + 0.5F;
      GL11.glTranslatef(
          0.0F, 0.0F * var7 - (1.0F - var2) * 1.2F - var17 * 0.5F + 0.04F, -0.9F * var7);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(var17 * -85.0F, 0.0F, 0.0F, 1.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));

      for (var9 = 0; var9 < 2; ++var9) {
        int var25 = var9 * 2 - 1;
        GL11.glPushMatrix();
        GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float) var25);
        GL11.glRotatef((float) (-45 * var25), 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef((float) (-65 * var25), 0.0F, 1.0F, 0.0F);
        Render var21 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
        RenderPlayer var24 = (RenderPlayer) var21;
        var13 = 1.0F;
        GL11.glScalef(var13, var13, var13);
        var24.drawFirstPersonHand();
        GL11.glPopMatrix();
      }

      var18 = var3.getSwingProgress(par1);
      var10 = MathHelper.sin(var18 * var18 * (float) Math.PI);
      var11 = MathHelper.sin(MathHelper.sqrt_float(var18) * (float) Math.PI);
      GL11.glRotatef(-var10 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var11 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-var11 * 80.0F, 1.0F, 0.0F, 0.0F);
      var18 = 0.38F;
      GL11.glScalef(var18, var18, var18);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-1.0F, -1.0F, 0.0F);
      var10 = 0.015625F;
      GL11.glScalef(var10, var10, var10);
      this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/misc/mapbg.png"));
      Tessellator var26 = Tessellator.instance;
      GL11.glNormal3f(0.0F, 0.0F, -1.0F);
      var26.startDrawingQuads();
      byte var27 = 7;
      var26.addVertexWithUV((double) (0 - var27), (double) (128 + var27), 0.0D, 0.0D, 1.0D);
      var26.addVertexWithUV((double) (128 + var27), (double) (128 + var27), 0.0D, 1.0D, 1.0D);
      var26.addVertexWithUV((double) (128 + var27), (double) (0 - var27), 0.0D, 1.0D, 0.0D);
      var26.addVertexWithUV((double) (0 - var27), (double) (0 - var27), 0.0D, 0.0D, 0.0D);
      var26.draw();
      MapData var23 = Item.map.getMapData(var14, this.mc.theWorld);
      this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var23);
      GL11.glPopMatrix();
    } else if (var14 != null) {
      GL11.glPushMatrix();
      var7 = 0.8F;
      float var12;
      if (var3.getItemInUseCount() > 0) {
        EnumAction var16 = var14.getItemUseAction();
        if (var16 == EnumAction.eat || var16 == EnumAction.drink) {
          var18 = (float) var3.getItemInUseCount() - par1 + 1.0F;
          var10 = 1.0F - var18 / (float) var14.getMaxItemUseDuration();
          var12 = 1.0F - var10;
          var12 = var12 * var12 * var12;
          var12 = var12 * var12 * var12;
          var12 = var12 * var12 * var12;
          var13 = 1.0F - var12;
          GL11.glTranslatef(
              0.0F,
              MathHelper.abs(MathHelper.cos(var18 / 4.0F * (float) Math.PI) * 0.1F)
                  * (float) ((double) var10 > 0.2D ? 1 : 0),
              0.0F);
          GL11.glTranslatef(var13 * 0.6F, -var13 * 0.5F, 0.0F);
          GL11.glRotatef(var13 * 90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(var13 * 10.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(var13 * 30.0F, 0.0F, 0.0F, 1.0F);
        }
      } else {
        var17 = var3.getSwingProgress(par1);
        var18 = MathHelper.sin(var17 * (float) Math.PI);
        var10 = MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI);
        GL11.glTranslatef(
            -var10 * 0.4F,
            MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI * 2.0F) * 0.2F,
            -var18 * 0.2F);
      }

      GL11.glTranslatef(0.7F * var7, -0.65F * var7 - (1.0F - var2) * 0.6F, -0.9F * var7);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      var17 = var3.getSwingProgress(par1);
      var18 = MathHelper.sin(var17 * var17 * (float) Math.PI);
      var10 = MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI);
      GL11.glRotatef(-var18 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var10 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-var10 * 80.0F, 1.0F, 0.0F, 0.0F);
      var17 = 0.4F;
      GL11.glScalef(var17, var17, var17);
      if (var3.getItemInUseCount() > 0) {
        EnumAction var20 = var14.getItemUseAction();
        if (var20 == EnumAction.block) {
          GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
          GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F);
        } else if (var20 == EnumAction.bow) {
          GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F);
          GL11.glTranslatef(-0.9F, 0.2F, 0.0F);
          var10 =
              (float) var14.getMaxItemUseDuration()
                  - ((float) var3.getItemInUseCount() - par1 + 1.0F);
          var11 = var10 / 20.0F;
          var11 = (var11 * var11 + var11 * 2.0F) / 3.0F;
          if (var11 > 1.0F) {
            var11 = 1.0F;
          }

          if (var11 > 0.1F) {
            GL11.glTranslatef(
                0.0F, MathHelper.sin((var10 - 0.1F) * 1.3F) * 0.01F * (var11 - 0.1F), 0.0F);
          }

          GL11.glTranslatef(0.0F, 0.0F, var11 * 0.1F);
          GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glTranslatef(0.0F, 0.5F, 0.0F);
          var12 = 1.0F + var11 * 0.2F;
          GL11.glScalef(1.0F, 1.0F, var12);
          GL11.glTranslatef(0.0F, -0.5F, 0.0F);
          GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
        }
      }

      if (var14.getItem().shouldRotateAroundWhenRendering()) {
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      }

      if (var14.getItem().func_46058_c()) {
        this.renderItem(var3, var14, 0);
        var9 = Item.itemsList[var14.itemID].getColorFromDamage(var14.getItemDamage(), 1);
        var10 = (float) (var9 >> 16 & 255) / 255.0F;
        var11 = (float) (var9 >> 8 & 255) / 255.0F;
        var12 = (float) (var9 & 255) / 255.0F;
        GL11.glColor4f(var6 * var10, var6 * var11, var6 * var12, 1.0F);
        this.renderItem(var3, var14, 1);
      } else {
        this.renderItem(var3, var14, 0);
      }

      GL11.glPopMatrix();
    } else {
      GL11.glPushMatrix();
      var7 = 0.8F;
      var17 = var3.getSwingProgress(par1);
      var18 = MathHelper.sin(var17 * (float) Math.PI);
      var10 = MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI);
      GL11.glTranslatef(
          -var10 * 0.3F,
          MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI * 2.0F) * 0.4F,
          -var18 * 0.4F);
      GL11.glTranslatef(0.8F * var7, -0.75F * var7 - (1.0F - var2) * 0.6F, -0.9F * var7);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      var17 = var3.getSwingProgress(par1);
      var18 = MathHelper.sin(var17 * var17 * (float) Math.PI);
      var10 = MathHelper.sin(MathHelper.sqrt_float(var17) * (float) Math.PI);
      GL11.glRotatef(var10 * 70.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var18 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
      GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
      GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(1.0F, 1.0F, 1.0F);
      GL11.glTranslatef(5.6F, 0.0F, 0.0F);
      Render var19 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
      RenderPlayer var22 = (RenderPlayer) var19;
      var10 = 1.0F;
      GL11.glScalef(var10, var10, var10);
      var22.drawFirstPersonHand();
      GL11.glPopMatrix();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.disableStandardItemLighting();
  }
Exemplo n.º 2
0
  /**
   * Renders the active item in the player's hand when in first person mode. Args: partialTickTime
   */
  public void renderItemInFirstPerson(float par1) {
    float f = prevEquippedProgress + (equippedProgress - prevEquippedProgress) * par1;
    EntityPlayerSP entityplayersp = mc.thePlayer;
    float f1 =
        ((EntityPlayer) (entityplayersp)).prevRotationPitch
            + (((EntityPlayer) (entityplayersp)).rotationPitch
                    - ((EntityPlayer) (entityplayersp)).prevRotationPitch)
                * par1;
    GL11.glPushMatrix();
    GL11.glRotatef(f1, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(
        ((EntityPlayer) (entityplayersp)).prevRotationYaw
            + (((EntityPlayer) (entityplayersp)).rotationYaw
                    - ((EntityPlayer) (entityplayersp)).prevRotationYaw)
                * par1,
        0.0F,
        1.0F,
        0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();

    if (entityplayersp instanceof EntityPlayerSP) {
      EntityPlayerSP entityplayersp1 = (EntityPlayerSP) entityplayersp;
      float f2 =
          entityplayersp1.prevRenderArmPitch
              + (entityplayersp1.renderArmPitch - entityplayersp1.prevRenderArmPitch) * par1;
      float f4 =
          entityplayersp1.prevRenderArmYaw
              + (entityplayersp1.renderArmYaw - entityplayersp1.prevRenderArmYaw) * par1;
      GL11.glRotatef(
          (((EntityPlayer) (entityplayersp)).rotationPitch - f2) * 0.1F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef((((EntityPlayer) (entityplayersp)).rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F);
    }

    ItemStack itemstack = itemToRender;
    float f3 =
        mc.theWorld.getLightBrightness(
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posX),
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posY),
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posZ));
    f3 = 1.0F;
    int i =
        mc.theWorld.getLightBrightnessForSkyBlocks(
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posX),
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posY),
            MathHelper.floor_double(((EntityPlayer) (entityplayersp)).posZ),
            0);
    int k = i % 0x10000;
    int l = i / 0x10000;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) k / 1.0F, (float) l / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if (itemstack != null) {
      int j = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), 0);
      float f8 = (float) (j >> 16 & 0xff) / 255F;
      float f13 = (float) (j >> 8 & 0xff) / 255F;
      float f19 = (float) (j & 0xff) / 255F;
      GL11.glColor4f(f3 * f8, f3 * f13, f3 * f19, 1.0F);
    } else {
      GL11.glColor4f(f3, f3, f3, 1.0F);
    }

    if (itemstack != null && itemstack.itemID == Item.map.shiftedIndex) {
      GL11.glPushMatrix();
      float f5 = 0.8F;
      float f9 = entityplayersp.getSwingProgress(par1);
      float f14 = MathHelper.sin(f9 * (float) Math.PI);
      float f20 = MathHelper.sin(MathHelper.sqrt_float(f9) * (float) Math.PI);
      GL11.glTranslatef(
          -f20 * 0.4F,
          MathHelper.sin(MathHelper.sqrt_float(f9) * (float) Math.PI * 2.0F) * 0.2F,
          -f14 * 0.2F);
      f9 = (1.0F - f1 / 45F) + 0.1F;

      if (f9 < 0.0F) {
        f9 = 0.0F;
      }

      if (f9 > 1.0F) {
        f9 = 1.0F;
      }

      f9 = -MathHelper.cos(f9 * (float) Math.PI) * 0.5F + 0.5F;
      GL11.glTranslatef(0.0F, (0.0F * f5 - (1.0F - f) * 1.2F - f9 * 0.5F) + 0.04F, -0.9F * f5);
      GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(f9 * -85F, 0.0F, 0.0F, 1.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          mc.renderEngine.getTextureForDownloadableImage(
              mc.thePlayer.skinUrl, mc.thePlayer.getTexture()));

      for (f14 = 0; f14 < 2; f14++) {
        f20 = f14 * 2 - 1;
        GL11.glPushMatrix();
        GL11.glTranslatef(-0F, -0.6F, 1.1F * (float) f20);
        GL11.glRotatef(-45 * f20, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(59F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-65 * f20, 0.0F, 1.0F, 0.0F);
        Render render1 = RenderManager.instance.getEntityRenderObject(mc.thePlayer);
        RenderPlayer renderplayer1 = (RenderPlayer) render1;
        float f34 = 1.0F;
        GL11.glScalef(f34, f34, f34);
        renderplayer1.drawFirstPersonHand();
        GL11.glPopMatrix();
      }

      f14 = entityplayersp.getSwingProgress(par1);
      f20 = MathHelper.sin(f14 * f14 * (float) Math.PI);
      float f27 = MathHelper.sin(MathHelper.sqrt_float(f14) * (float) Math.PI);
      GL11.glRotatef(-f20 * 20F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f27 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f27 * 80F, 1.0F, 0.0F, 0.0F);
      f14 = 0.38F;
      GL11.glScalef(f14, f14, f14);
      GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-1F, -1F, 0.0F);
      f20 = 0.015625F;
      GL11.glScalef(f20, f20, f20);
      mc.renderEngine.bindTexture(mc.renderEngine.getTexture("/misc/mapbg.png"));
      Tessellator tessellator = Tessellator.instance;
      GL11.glNormal3f(0.0F, 0.0F, -1F);
      tessellator.startDrawingQuads();
      byte byte0 = 7;
      tessellator.addVertexWithUV(0 - byte0, 128 + byte0, 0.0D, 0.0D, 1.0D);
      tessellator.addVertexWithUV(128 + byte0, 128 + byte0, 0.0D, 1.0D, 1.0D);
      tessellator.addVertexWithUV(128 + byte0, 0 - byte0, 0.0D, 1.0D, 0.0D);
      tessellator.addVertexWithUV(0 - byte0, 0 - byte0, 0.0D, 0.0D, 0.0D);
      tessellator.draw();
      MapData mapdata = Item.map.getMapData(itemstack, mc.theWorld);
      mapItemRenderer.renderMap(mc.thePlayer, mc.renderEngine, mapdata);
      GL11.glPopMatrix();
    } else if (itemstack != null) {
      GL11.glPushMatrix();
      float f6 = 0.8F;

      if (entityplayersp.getItemInUseCount() > 0) {
        EnumAction enumaction = itemstack.getItemUseAction();

        if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) {
          float f15 = ((float) entityplayersp.getItemInUseCount() - par1) + 1.0F;
          float f21 = 1.0F - f15 / (float) itemstack.getMaxItemUseDuration();
          float f28 = f21;
          float f31 = 1.0F - f28;
          f31 = f31 * f31 * f31;
          f31 = f31 * f31 * f31;
          f31 = f31 * f31 * f31;
          float f35 = 1.0F - f31;
          GL11.glTranslatef(
              0.0F,
              MathHelper.abs(MathHelper.cos((f15 / 4F) * (float) Math.PI) * 0.1F)
                  * (float) ((double) f28 <= 0.20000000000000001D ? 0 : 1),
              0.0F);
          GL11.glTranslatef(f35 * 0.6F, -f35 * 0.5F, 0.0F);
          GL11.glRotatef(f35 * 90F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(f35 * 10F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(f35 * 30F, 0.0F, 0.0F, 1.0F);
        }
      } else {
        float f10 = entityplayersp.getSwingProgress(par1);
        float f16 = MathHelper.sin(f10 * (float) Math.PI);
        float f22 = MathHelper.sin(MathHelper.sqrt_float(f10) * (float) Math.PI);
        GL11.glTranslatef(
            -f22 * 0.4F,
            MathHelper.sin(MathHelper.sqrt_float(f10) * (float) Math.PI * 2.0F) * 0.2F,
            -f16 * 0.2F);
      }

      GL11.glTranslatef(0.7F * f6, -0.65F * f6 - (1.0F - f) * 0.6F, -0.9F * f6);
      GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      float f11 = entityplayersp.getSwingProgress(par1);
      float f17 = MathHelper.sin(f11 * f11 * (float) Math.PI);
      float f23 = MathHelper.sin(MathHelper.sqrt_float(f11) * (float) Math.PI);
      GL11.glRotatef(-f17 * 20F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f23 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f23 * 80F, 1.0F, 0.0F, 0.0F);
      f11 = 0.4F;
      GL11.glScalef(f11, f11, f11);

      if (entityplayersp.getItemInUseCount() > 0) {
        EnumAction enumaction1 = itemstack.getItemUseAction();

        if (enumaction1 == EnumAction.block) {
          GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
          GL11.glRotatef(30F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-80F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
        } else if (enumaction1 == EnumAction.bow) {
          GL11.glRotatef(-18F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-12F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-8F, 1.0F, 0.0F, 0.0F);
          GL11.glTranslatef(-0.9F, 0.2F, 0.0F);
          float f24 =
              (float) itemstack.getMaxItemUseDuration()
                  - (((float) entityplayersp.getItemInUseCount() - par1) + 1.0F);
          float f29 = f24 / 20F;
          f29 = (f29 * f29 + f29 * 2.0F) / 3F;

          if (f29 > 1.0F) {
            f29 = 1.0F;
          }

          if (f29 > 0.1F) {
            GL11.glTranslatef(
                0.0F, MathHelper.sin((f24 - 0.1F) * 1.3F) * 0.01F * (f29 - 0.1F), 0.0F);
          }

          GL11.glTranslatef(0.0F, 0.0F, f29 * 0.1F);
          GL11.glRotatef(-335F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-50F, 0.0F, 1.0F, 0.0F);
          GL11.glTranslatef(0.0F, 0.5F, 0.0F);
          float f32 = 1.0F + f29 * 0.2F;
          GL11.glScalef(1.0F, 1.0F, f32);
          GL11.glTranslatef(0.0F, -0.5F, 0.0F);
          GL11.glRotatef(50F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335F, 0.0F, 0.0F, 1.0F);
        }
      }

      if (itemstack.getItem().shouldRotateAroundWhenRendering()) {
        GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
      }

      if (itemstack.getItem().func_46058_c()) {
        renderItem(entityplayersp, itemstack, 0);
        int i1 = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), 1);
        float f25 = (float) (i1 >> 16 & 0xff) / 255F;
        float f30 = (float) (i1 >> 8 & 0xff) / 255F;
        float f33 = (float) (i1 & 0xff) / 255F;
        GL11.glColor4f(f3 * f25, f3 * f30, f3 * f33, 1.0F);
        renderItem(entityplayersp, itemstack, 1);
      } else {
        renderItem(entityplayersp, itemstack, 0);
      }

      GL11.glPopMatrix();
    } else {
      GL11.glPushMatrix();
      float f7 = 0.8F;
      float f12 = entityplayersp.getSwingProgress(par1);
      float f18 = MathHelper.sin(f12 * (float) Math.PI);
      float f26 = MathHelper.sin(MathHelper.sqrt_float(f12) * (float) Math.PI);
      GL11.glTranslatef(
          -f26 * 0.3F,
          MathHelper.sin(MathHelper.sqrt_float(f12) * (float) Math.PI * 2.0F) * 0.4F,
          -f18 * 0.4F);
      GL11.glTranslatef(0.8F * f7, -0.75F * f7 - (1.0F - f) * 0.6F, -0.9F * f7);
      GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      f12 = entityplayersp.getSwingProgress(par1);
      f18 = MathHelper.sin(f12 * f12 * (float) Math.PI);
      f26 = MathHelper.sin(MathHelper.sqrt_float(f12) * (float) Math.PI);
      GL11.glRotatef(f26 * 70F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f18 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          mc.renderEngine.getTextureForDownloadableImage(
              mc.thePlayer.skinUrl, mc.thePlayer.getTexture()));
      GL11.glTranslatef(-1F, 3.6F, 3.5F);
      GL11.glRotatef(120F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(1.0F, 1.0F, 1.0F);
      GL11.glTranslatef(5.6F, 0.0F, 0.0F);
      Render render = RenderManager.instance.getEntityRenderObject(mc.thePlayer);
      RenderPlayer renderplayer = (RenderPlayer) render;
      f26 = 1.0F;
      GL11.glScalef(f26, f26, f26);
      renderplayer.drawFirstPersonHand();
      GL11.glPopMatrix();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.disableStandardItemLighting();
  }
Exemplo n.º 3
0
  /**
   * Renders the active item in the player's hand when in first person mode. Args: partialTickTime
   */
  public void renderItemInFirstPerson(float par1) {
    float var2 =
        this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1;
    EntityClientPlayerMP var3 = this.mc.thePlayer;
    float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * par1;
    GL11.glPushMatrix();
    GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(
        var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();
    float var5;
    float var6;

    if (var3 instanceof EntityPlayerSP) {
      var5 = var3.prevRenderArmPitch + (var3.renderArmPitch - var3.prevRenderArmPitch) * par1;
      var6 = var3.prevRenderArmYaw + (var3.renderArmYaw - var3.prevRenderArmYaw) * par1;
      GL11.glRotatef((var3.rotationPitch - var5) * 0.1F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef((var3.rotationYaw - var6) * 0.1F, 0.0F, 1.0F, 0.0F);
    }

    ItemStack var7 = this.itemToRender;
    var5 =
        this.mc.theWorld.getLightBrightness(
            MathHelper.floor_double(var3.posX),
            MathHelper.floor_double(var3.posY),
            MathHelper.floor_double(var3.posZ));
    var5 = 1.0F;
    int var8 =
        this.mc.theWorld.getLightBrightnessForSkyBlocks(
            MathHelper.floor_double(var3.posX),
            MathHelper.floor_double(var3.posY),
            MathHelper.floor_double(var3.posZ),
            0);
    int var9 = var8 % 65536;
    int var10 = var8 / 65536;
    OpenGlHelper.setLightmapTextureCoords(
        OpenGlHelper.lightmapTexUnit, (float) var9 / 1.0F, (float) var10 / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float var11;
    float var12;
    float var13;

    if (var7 != null) {
      var8 = Item.itemsList[var7.itemID].getColorFromItemStack(var7, 0);
      var13 = (float) (var8 >> 16 & 255) / 255.0F;
      var12 = (float) (var8 >> 8 & 255) / 255.0F;
      var11 = (float) (var8 & 255) / 255.0F;
      GL11.glColor4f(var5 * var13, var5 * var12, var5 * var11, 1.0F);
    } else {
      GL11.glColor4f(var5, var5, var5, 1.0F);
    }

    float var14;
    float var15;
    Render var17;
    float var16;
    RenderPlayer var18;

    if (var7 != null && var7.itemID == Item.map.itemID) {
      GL11.glPushMatrix();
      var6 = 0.8F;
      var13 = var3.getSwingProgress(par1);
      var12 = MathHelper.sin(var13 * (float) Math.PI);
      var11 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI);
      GL11.glTranslatef(
          -var11 * 0.4F,
          MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI * 2.0F) * 0.2F,
          -var12 * 0.2F);
      var13 = 1.0F - var4 / 45.0F + 0.1F;

      if (var13 < 0.0F) {
        var13 = 0.0F;
      }

      if (var13 > 1.0F) {
        var13 = 1.0F;
      }

      var13 = -MathHelper.cos(var13 * (float) Math.PI) * 0.5F + 0.5F;
      GL11.glTranslatef(
          0.0F, 0.0F * var6 - (1.0F - var2) * 1.2F - var13 * 0.5F + 0.04F, -0.9F * var6);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(var13 * -85.0F, 0.0F, 0.0F, 1.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));

      for (var10 = 0; var10 < 2; ++var10) {
        int var24 = var10 * 2 - 1;
        GL11.glPushMatrix();
        GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float) var24);
        GL11.glRotatef((float) (-45 * var24), 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef((float) (-65 * var24), 0.0F, 1.0F, 0.0F);
        var17 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
        var18 = (RenderPlayer) var17;
        var16 = 1.0F;
        GL11.glScalef(var16, var16, var16);
        var18.func_82441_a(this.mc.thePlayer);
        GL11.glPopMatrix();
      }

      var12 = var3.getSwingProgress(par1);
      var11 = MathHelper.sin(var12 * var12 * (float) Math.PI);
      var14 = MathHelper.sin(MathHelper.sqrt_float(var12) * (float) Math.PI);
      GL11.glRotatef(-var11 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var14 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-var14 * 80.0F, 1.0F, 0.0F, 0.0F);
      var15 = 0.38F;
      GL11.glScalef(var15, var15, var15);
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-1.0F, -1.0F, 0.0F);
      var16 = 0.015625F;
      GL11.glScalef(var16, var16, var16);
      this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/misc/mapbg.png"));
      Tessellator var25 = Tessellator.instance;
      GL11.glNormal3f(0.0F, 0.0F, -1.0F);
      var25.startDrawingQuads();
      byte var23 = 7;
      var25.addVertexWithUV((double) (0 - var23), (double) (128 + var23), 0.0D, 0.0D, 1.0D);
      var25.addVertexWithUV((double) (128 + var23), (double) (128 + var23), 0.0D, 1.0D, 1.0D);
      var25.addVertexWithUV((double) (128 + var23), (double) (0 - var23), 0.0D, 1.0D, 0.0D);
      var25.addVertexWithUV((double) (0 - var23), (double) (0 - var23), 0.0D, 0.0D, 0.0D);
      var25.draw();
      MapData var27 = Item.map.getMapData(var7, this.mc.theWorld);

      if (var27 != null) {
        this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var27);
      }

      GL11.glPopMatrix();
    } else if (var7 != null) {
      GL11.glPushMatrix();
      var6 = 0.8F;

      if (var3.getItemInUseCount() > 0) {
        EnumAction var19 = var7.getItemUseAction();

        if (var19 == EnumAction.eat || var19 == EnumAction.drink) {
          var12 = (float) var3.getItemInUseCount() - par1 + 1.0F;
          var11 = 1.0F - var12 / (float) var7.getMaxItemUseDuration();
          var14 = 1.0F - var11;
          var14 = var14 * var14 * var14;
          var14 = var14 * var14 * var14;
          var14 = var14 * var14 * var14;
          var15 = 1.0F - var14;
          GL11.glTranslatef(
              0.0F,
              MathHelper.abs(MathHelper.cos(var12 / 4.0F * (float) Math.PI) * 0.1F)
                  * (float) ((double) var11 > 0.2D ? 1 : 0),
              0.0F);
          GL11.glTranslatef(var15 * 0.6F, -var15 * 0.5F, 0.0F);
          GL11.glRotatef(var15 * 90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(var15 * 10.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(var15 * 30.0F, 0.0F, 0.0F, 1.0F);
        }
      } else {
        var13 = var3.getSwingProgress(par1);
        var12 = MathHelper.sin(var13 * (float) Math.PI);
        var11 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI);
        GL11.glTranslatef(
            -var11 * 0.4F,
            MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI * 2.0F) * 0.2F,
            -var12 * 0.2F);
      }

      GL11.glTranslatef(0.7F * var6, -0.65F * var6 - (1.0F - var2) * 0.6F, -0.9F * var6);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      var13 = var3.getSwingProgress(par1);
      var12 = MathHelper.sin(var13 * var13 * (float) Math.PI);
      var11 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI);
      GL11.glRotatef(-var12 * 20.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var11 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-var11 * 80.0F, 1.0F, 0.0F, 0.0F);
      var14 = 0.4F;
      GL11.glScalef(var14, var14, var14);
      float var20;
      float var22;

      if (var3.getItemInUseCount() > 0) {
        EnumAction var21 = var7.getItemUseAction();

        if (var21 == EnumAction.block) {
          GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
          GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F);
        } else if (var21 == EnumAction.bow) {
          GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F);
          GL11.glTranslatef(-0.9F, 0.2F, 0.0F);
          var16 =
              (float) var7.getMaxItemUseDuration()
                  - ((float) var3.getItemInUseCount() - par1 + 1.0F);
          var22 = var16 / 20.0F;
          var22 = (var22 * var22 + var22 * 2.0F) / 3.0F;

          if (var22 > 1.0F) {
            var22 = 1.0F;
          }

          if (var22 > 0.1F) {
            GL11.glTranslatef(
                0.0F, MathHelper.sin((var16 - 0.1F) * 1.3F) * 0.01F * (var22 - 0.1F), 0.0F);
          }

          GL11.glTranslatef(0.0F, 0.0F, var22 * 0.1F);
          GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glTranslatef(0.0F, 0.5F, 0.0F);
          var20 = 1.0F + var22 * 0.2F;
          GL11.glScalef(1.0F, 1.0F, var20);
          GL11.glTranslatef(0.0F, -0.5F, 0.0F);
          GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
        }
      }

      if (var7.getItem().shouldRotateAroundWhenRendering()) {
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      }

      if (var7.getItem().requiresMultipleRenderPasses()) {
        this.renderItem(var3, var7, 0);
        int var26 = Item.itemsList[var7.itemID].getColorFromItemStack(var7, 1);
        var16 = (float) (var26 >> 16 & 255) / 255.0F;
        var22 = (float) (var26 >> 8 & 255) / 255.0F;
        var20 = (float) (var26 & 255) / 255.0F;
        GL11.glColor4f(var5 * var16, var5 * var22, var5 * var20, 1.0F);
        this.renderItem(var3, var7, 1);
      } else {
        this.renderItem(var3, var7, 0);
      }

      GL11.glPopMatrix();
    } else if (!var3.getHasActivePotion()) {
      GL11.glPushMatrix();
      var6 = 0.8F;
      var13 = var3.getSwingProgress(par1);
      var12 = MathHelper.sin(var13 * (float) Math.PI);
      var11 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI);
      GL11.glTranslatef(
          -var11 * 0.3F,
          MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI * 2.0F) * 0.4F,
          -var12 * 0.4F);
      GL11.glTranslatef(0.8F * var6, -0.75F * var6 - (1.0F - var2) * 0.6F, -0.9F * var6);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      var13 = var3.getSwingProgress(par1);
      var12 = MathHelper.sin(var13 * var13 * (float) Math.PI);
      var11 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float) Math.PI);
      GL11.glRotatef(var11 * 70.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-var12 * 20.0F, 0.0F, 0.0F, 1.0F);
      GL11.glBindTexture(
          GL11.GL_TEXTURE_2D,
          this.mc.renderEngine.getTextureForDownloadableImage(
              this.mc.thePlayer.skinUrl, this.mc.thePlayer.getTexture()));
      GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
      GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(1.0F, 1.0F, 1.0F);
      GL11.glTranslatef(5.6F, 0.0F, 0.0F);
      var17 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer);
      var18 = (RenderPlayer) var17;
      var16 = 1.0F;
      GL11.glScalef(var16, var16, var16);
      var18.func_82441_a(this.mc.thePlayer);
      GL11.glPopMatrix();
    }

    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.disableStandardItemLighting();
  }
Exemplo n.º 4
0
  public void func_78440_a(float p_78440_1_) {
    float f = field_78451_d + (field_78454_c - field_78451_d) * p_78440_1_;
    EntityClientPlayerMP entityclientplayermp = field_78455_a.field_71439_g;
    float f1 =
        ((EntityPlayer) (entityclientplayermp)).field_70127_C
            + (((EntityPlayer) (entityclientplayermp)).field_70125_A
                    - ((EntityPlayer) (entityclientplayermp)).field_70127_C)
                * p_78440_1_;
    GL11.glPushMatrix();
    GL11.glRotatef(f1, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(
        ((EntityPlayer) (entityclientplayermp)).field_70126_B
            + (((EntityPlayer) (entityclientplayermp)).field_70177_z
                    - ((EntityPlayer) (entityclientplayermp)).field_70126_B)
                * p_78440_1_,
        0.0F,
        1.0F,
        0.0F);
    RenderHelper.func_74519_b();
    GL11.glPopMatrix();
    if (entityclientplayermp instanceof EntityPlayerSP) {
      EntityClientPlayerMP entityclientplayermp1 = entityclientplayermp;
      float f2 =
          ((EntityPlayerSP) (entityclientplayermp1)).field_71164_i
              + (((EntityPlayerSP) (entityclientplayermp1)).field_71155_g
                      - ((EntityPlayerSP) (entityclientplayermp1)).field_71164_i)
                  * p_78440_1_;
      float f4 =
          ((EntityPlayerSP) (entityclientplayermp1)).field_71163_h
              + (((EntityPlayerSP) (entityclientplayermp1)).field_71154_f
                      - ((EntityPlayerSP) (entityclientplayermp1)).field_71163_h)
                  * p_78440_1_;
      GL11.glRotatef(
          (((EntityPlayer) (entityclientplayermp)).field_70125_A - f2) * 0.1F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(
          (((EntityPlayer) (entityclientplayermp)).field_70177_z - f4) * 0.1F, 0.0F, 1.0F, 0.0F);
    }
    ItemStack itemstack = field_78453_b;
    float f3 =
        field_78455_a.field_71441_e.func_72801_o(
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70165_t),
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70163_u),
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70161_v));
    f3 = 1.0F;
    int i =
        field_78455_a.field_71441_e.func_72802_i(
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70165_t),
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70163_u),
            MathHelper.func_76128_c(((EntityPlayer) (entityclientplayermp)).field_70161_v),
            0);
    int j = i % 0x10000;
    int k = i / 0x10000;
    OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float) j / 1.0F, (float) k / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    if (itemstack != null) {
      int l = Item.field_77698_e[itemstack.field_77993_c].func_77620_a(itemstack.func_77960_j(), 0);
      float f8 = (float) (l >> 16 & 0xff) / 255F;
      float f13 = (float) (l >> 8 & 0xff) / 255F;
      float f19 = (float) (l & 0xff) / 255F;
      GL11.glColor4f(f3 * f8, f3 * f13, f3 * f19, 1.0F);
    } else {
      GL11.glColor4f(f3, f3, f3, 1.0F);
    }
    if (itemstack != null && itemstack.field_77993_c == Item.field_77744_bd.field_77779_bT) {
      GL11.glPushMatrix();
      float f5 = 0.8F;
      float f9 = entityclientplayermp.func_70678_g(p_78440_1_);
      float f14 = MathHelper.func_76126_a(f9 * 3.141593F);
      float f20 = MathHelper.func_76126_a(MathHelper.func_76129_c(f9) * 3.141593F);
      GL11.glTranslatef(
          -f20 * 0.4F,
          MathHelper.func_76126_a(MathHelper.func_76129_c(f9) * 3.141593F * 2.0F) * 0.2F,
          -f14 * 0.2F);
      f9 = (1.0F - f1 / 45F) + 0.1F;
      if (f9 < 0.0F) {
        f9 = 0.0F;
      }
      if (f9 > 1.0F) {
        f9 = 1.0F;
      }
      f9 = -MathHelper.func_76134_b(f9 * 3.141593F) * 0.5F + 0.5F;
      GL11.glTranslatef(0.0F, (0.0F * f5 - (1.0F - f) * 1.2F - f9 * 0.5F) + 0.04F, -0.9F * f5);
      GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(f9 * -85F, 0.0F, 0.0F, 1.0F);
      GL11.glEnable(32826);
      GL11.glBindTexture(
          3553,
          field_78455_a.field_71446_o.func_78350_a(
              field_78455_a.field_71439_g.field_70120_cr,
              field_78455_a.field_71439_g.func_70073_O()));
      for (f14 = 0.0F; f14 < 2.0F; f14++) {
        f20 = f14 * 2.0F - 1.0F;
        GL11.glPushMatrix();
        GL11.glTranslatef(-0F, -0.6F, 1.1F * f20);
        GL11.glRotatef(-45F * f20, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(59F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-65F * f20, 0.0F, 1.0F, 0.0F);
        Render render = RenderManager.field_78727_a.func_78713_a(field_78455_a.field_71439_g);
        RenderPlayer renderplayer = (RenderPlayer) render;
        float f30 = 1.0F;
        GL11.glScalef(f30, f30, f30);
        renderplayer.func_77106_b();
        GL11.glPopMatrix();
      }

      f14 = entityclientplayermp.func_70678_g(p_78440_1_);
      f20 = MathHelper.func_76126_a(f14 * f14 * 3.141593F);
      float f25 = MathHelper.func_76126_a(MathHelper.func_76129_c(f14) * 3.141593F);
      GL11.glRotatef(-f20 * 20F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f25 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f25 * 80F, 1.0F, 0.0F, 0.0F);
      float f28 = 0.38F;
      GL11.glScalef(f28, f28, f28);
      GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-1F, -1F, 0.0F);
      float f31 = 0.015625F;
      GL11.glScalef(f31, f31, f31);
      field_78455_a.field_71446_o.func_78342_b(
          field_78455_a.field_71446_o.func_78341_b("/misc/mapbg.png"));
      Tessellator tessellator = Tessellator.field_78398_a;
      GL11.glNormal3f(0.0F, 0.0F, -1F);
      tessellator.func_78382_b();
      byte byte0 = 7;
      tessellator.func_78374_a(0 - byte0, 128 + byte0, 0.0D, 0.0D, 1.0D);
      tessellator.func_78374_a(128 + byte0, 128 + byte0, 0.0D, 1.0D, 1.0D);
      tessellator.func_78374_a(128 + byte0, 0 - byte0, 0.0D, 1.0D, 0.0D);
      tessellator.func_78374_a(0 - byte0, 0 - byte0, 0.0D, 0.0D, 0.0D);
      tessellator.func_78381_a();
      MapData mapdata = Item.field_77744_bd.func_77873_a(itemstack, field_78455_a.field_71441_e);
      field_78449_f.func_78319_a(field_78455_a.field_71439_g, field_78455_a.field_71446_o, mapdata);
      GL11.glPopMatrix();
    } else if (itemstack != null) {
      GL11.glPushMatrix();
      float f6 = 0.8F;
      if (entityclientplayermp.func_71052_bv() > 0) {
        EnumAction enumaction = itemstack.func_77975_n();
        if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) {
          float f15 = ((float) entityclientplayermp.func_71052_bv() - p_78440_1_) + 1.0F;
          float f21 = 1.0F - f15 / (float) itemstack.func_77988_m();
          float f26 = 1.0F - f21;
          f26 = f26 * f26 * f26;
          f26 = f26 * f26 * f26;
          f26 = f26 * f26 * f26;
          float f29 = 1.0F - f26;
          GL11.glTranslatef(
              0.0F,
              MathHelper.func_76135_e(MathHelper.func_76134_b((f15 / 4F) * 3.141593F) * 0.1F)
                  * (float) ((double) f21 > 0.20000000000000001D ? 1 : 0),
              0.0F);
          GL11.glTranslatef(f29 * 0.6F, -f29 * 0.5F, 0.0F);
          GL11.glRotatef(f29 * 90F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(f29 * 10F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(f29 * 30F, 0.0F, 0.0F, 1.0F);
        }
      } else {
        float f10 = entityclientplayermp.func_70678_g(p_78440_1_);
        float f16 = MathHelper.func_76126_a(f10 * 3.141593F);
        float f22 = MathHelper.func_76126_a(MathHelper.func_76129_c(f10) * 3.141593F);
        GL11.glTranslatef(
            -f22 * 0.4F,
            MathHelper.func_76126_a(MathHelper.func_76129_c(f10) * 3.141593F * 2.0F) * 0.2F,
            -f16 * 0.2F);
      }
      GL11.glTranslatef(0.7F * f6, -0.65F * f6 - (1.0F - f) * 0.6F, -0.9F * f6);
      GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(32826);
      float f11 = entityclientplayermp.func_70678_g(p_78440_1_);
      float f17 = MathHelper.func_76126_a(f11 * f11 * 3.141593F);
      float f23 = MathHelper.func_76126_a(MathHelper.func_76129_c(f11) * 3.141593F);
      GL11.glRotatef(-f17 * 20F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f23 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f23 * 80F, 1.0F, 0.0F, 0.0F);
      float f27 = 0.4F;
      GL11.glScalef(f27, f27, f27);
      if (entityclientplayermp.func_71052_bv() > 0) {
        EnumAction enumaction1 = itemstack.func_77975_n();
        if (enumaction1 == EnumAction.block) {
          GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
          GL11.glRotatef(30F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-80F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(60F, 0.0F, 1.0F, 0.0F);
        } else if (enumaction1 == EnumAction.bow) {
          GL11.glRotatef(-18F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-12F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-8F, 1.0F, 0.0F, 0.0F);
          GL11.glTranslatef(-0.9F, 0.2F, 0.0F);
          float f32 =
              (float) itemstack.func_77988_m()
                  - (((float) entityclientplayermp.func_71052_bv() - p_78440_1_) + 1.0F);
          float f35 = f32 / 20F;
          f35 = (f35 * f35 + f35 * 2.0F) / 3F;
          if (f35 > 1.0F) {
            f35 = 1.0F;
          }
          if (f35 > 0.1F) {
            GL11.glTranslatef(
                0.0F, MathHelper.func_76126_a((f32 - 0.1F) * 1.3F) * 0.01F * (f35 - 0.1F), 0.0F);
          }
          GL11.glTranslatef(0.0F, 0.0F, f35 * 0.1F);
          GL11.glRotatef(-335F, 0.0F, 0.0F, 1.0F);
          GL11.glRotatef(-50F, 0.0F, 1.0F, 0.0F);
          GL11.glTranslatef(0.0F, 0.5F, 0.0F);
          float f37 = 1.0F + f35 * 0.2F;
          GL11.glScalef(1.0F, 1.0F, f37);
          GL11.glTranslatef(0.0F, -0.5F, 0.0F);
          GL11.glRotatef(50F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(335F, 0.0F, 0.0F, 1.0F);
        }
      }
      if (itemstack.func_77973_b().func_77629_n_()) {
        GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
      }
      if (itemstack.func_77973_b().func_77623_v()) {
        func_78443_a(entityclientplayermp, itemstack, 0);
        int i1 =
            Item.field_77698_e[itemstack.field_77993_c].func_77620_a(itemstack.func_77960_j(), 1);
        float f33 = (float) (i1 >> 16 & 0xff) / 255F;
        float f36 = (float) (i1 >> 8 & 0xff) / 255F;
        float f38 = (float) (i1 & 0xff) / 255F;
        GL11.glColor4f(f3 * f33, f3 * f36, f3 * f38, 1.0F);
        func_78443_a(entityclientplayermp, itemstack, 1);
      } else {
        func_78443_a(entityclientplayermp, itemstack, 0);
      }
      GL11.glPopMatrix();
    } else {
      GL11.glPushMatrix();
      float f7 = 0.8F;
      float f12 = entityclientplayermp.func_70678_g(p_78440_1_);
      float f18 = MathHelper.func_76126_a(f12 * 3.141593F);
      float f24 = MathHelper.func_76126_a(MathHelper.func_76129_c(f12) * 3.141593F);
      GL11.glTranslatef(
          -f24 * 0.3F,
          MathHelper.func_76126_a(MathHelper.func_76129_c(f12) * 3.141593F * 2.0F) * 0.4F,
          -f18 * 0.4F);
      GL11.glTranslatef(0.8F * f7, -0.75F * f7 - (1.0F - f) * 0.6F, -0.9F * f7);
      GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      GL11.glEnable(32826);
      f12 = entityclientplayermp.func_70678_g(p_78440_1_);
      f18 = MathHelper.func_76126_a(f12 * f12 * 3.141593F);
      f24 = MathHelper.func_76126_a(MathHelper.func_76129_c(f12) * 3.141593F);
      GL11.glRotatef(f24 * 70F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-f18 * 20F, 0.0F, 0.0F, 1.0F);
      GL11.glBindTexture(
          3553,
          field_78455_a.field_71446_o.func_78350_a(
              field_78455_a.field_71439_g.field_70120_cr,
              field_78455_a.field_71439_g.func_70073_O()));
      GL11.glTranslatef(-1F, 3.6F, 3.5F);
      GL11.glRotatef(120F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(1.0F, 1.0F, 1.0F);
      GL11.glTranslatef(5.6F, 0.0F, 0.0F);
      Render render1 = RenderManager.field_78727_a.func_78713_a(field_78455_a.field_71439_g);
      RenderPlayer renderplayer1 = (RenderPlayer) render1;
      float f34 = 1.0F;
      GL11.glScalef(f34, f34, f34);
      renderplayer1.func_77106_b();
      GL11.glPopMatrix();
    }
    GL11.glDisable(32826);
    RenderHelper.func_74518_a();
  }