private boolean RenderWarheadInWorld(
     RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block) {
   if (world.getBlockMetadata(x, y, z) != 12
       && world.getBlockMetadata(x, y, z) != 0
       && world.getBlockMetadata(x, y, z) != 15) {
     block.setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 0.7F, .9F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.2F, 0.7F, 0.2F, 0.8F, 0.9F, 0.8F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.3F, 0.9F, 0.3F, 0.7F, 1F, 0.7F);
     renderer.renderStandardBlock(block, x, y, z);
   } else {
     block.setBlockBounds(0.0F, 0.0F, 0F, 1F, 0.1F, 1F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0F, 0.1F, 0F, 1F, 1F, .1F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0F, 0.1F, 0.9F, 1F, 1F, 1F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0F, 0.1F, 0.1F, 0.1F, 1F, 0.9F);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.9F, 0.1F, 0.1F, 1F, 1F, .9F);
     renderer.renderStandardBlock(block, x, y, z);
   }
   block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
   return true;
 }
  private boolean RenderMissileInWorld(
      RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block) {
    block.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, .9375F);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(0.4375F, 0.75F, 0.0625F, 0.5625F, 0F, 0F);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(0.4375F, 0.75F, 1.0F, 0.5625F, 0F, 0.9375F);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(1.0F, 0.75F, 0.4375F, 0.9375F, 0F, 0.5625F);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(.0625F, 0.75F, 0.4375F, 0F, 0F, 0.5625F);
    renderer.renderStandardBlock(block, x, y, z);

    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    return true;
  }
 private void renderMenuBlock(Block block, float f, RenderBlocks renderblocks) {
   int i = block.getRenderType();
   renderblocks.setRenderBoundsFromBlock(block);
   Tessellator tessellator = Tessellator.instance;
   if (i == 0) {
     block.setBlockBoundsForItemRender();
     GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
     float f1 = 0.5F;
     float f2 = 1.0F;
     float f3 = 0.8F;
     float f4 = 0.6F;
     tessellator.startDrawingQuads();
     tessellator.setColorRGBA_F(f2, f2, f2, f);
     renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0));
     tessellator.setColorRGBA_F(f1, f1, f1, f);
     renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1));
     tessellator.setColorRGBA_F(f3, f3, f3, f);
     renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2));
     renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3));
     tessellator.setColorRGBA_F(f4, f4, f4, f);
     renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4));
     renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5));
     tessellator.draw();
     GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   }
 }
  // Renders the look of the fence in Inventory
  public void RenderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
    Tessellator tessellator = Tessellator.instance;

    // (0.0F, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth);
    block.setBlockBounds(0.0F, 0.0F, 0.3F, 1.0F, 0.8F, 0.7F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1F, 0.0F);
    renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1F);
    renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1F, 0.0F, 0.0F);
    renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5));
    tessellator.draw();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);

    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
  }
 private void RenderMissileInInv(RenderBlocks renderer, Block block, int metadata) {
   Tessellator tesselator = Tessellator.instance;
   int sideTex = 0;
   int topTex = 0;
   for (int i = 0; i < 6; i++) {
     // Get bounds for each rectangle
     if (i == 0) block.setBlockBounds(0.4F, 0.95F, 0.4F, 0.6F, 1.0F, 0.6F);
     else if (i == 1) block.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.95F, 0.7F);
     else if (i == 2) block.setBlockBounds(0.4F, 0F, 0.1F, 0.6F, 0.4F, 0.3F);
     else if (i == 3) block.setBlockBounds(0.4F, 0F, 0.7F, 0.6F, 0.4F, 0.9F);
     else if (i == 4) block.setBlockBounds(0.1F, 0F, 0.4F, 0.3F, 0.4F, 0.6F);
     else if (i == 5) block.setBlockBounds(0.7F, 0F, 0.4F, 0.9F, 0.4F, 0.6F);
     // Get textures
     if (i == 0 && metadata != 0 && metadata != 15) {
       topTex = 15;
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (i == 0) {
       topTex = 18;
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (i == 1 && metadata != 0 && metadata != 15) {
       sideTex = block.getBlockTextureFromSideAndMetadata(1, 1);
       topTex = block.getBlockTextureFromSideAndMetadata(1, 1);
     } else if (i == 1) {
       sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
       topTex = block.getBlockTextureFromSideAndMetadata(1, metadata);
     } else if (metadata != 0 && metadata != 15) {
       sideTex = topTex = 15;
     } else {
       sideTex = topTex = 18;
     }
     GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, -1.0F, 0.0F);
     renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 1.0F, 0.0F);
     renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, topTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 0.0F, -1.0F);
     renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(0.0F, 0.0F, 1.0F);
     renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(-1.0F, 0.0F, 0.0F);
     renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     tesselator.startDrawingQuads();
     tesselator.setNormal(1.0F, 0.0F, 0.0F);
     renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, sideTex);
     tesselator.draw();
     GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   }
   block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
 }
  public static boolean render(Block block, int i, int j, int k, RenderBlocks renderblocks) {
    TileEntitySuperDetailed te =
        (TileEntitySuperDetailed) renderblocks.blockAccess.getBlockTileEntity(i, j, k);
    int md = renderblocks.blockAccess.getBlockMetadata(i, j, k);

    boolean breaking = false;
    if (renderblocks.overrideBlockTexture >= 240) {
      breaking = true;
    }

    for (int subX = 0; subX < 8; subX++) {
      for (int subZ = 0; subZ < 8; subZ++) {
        for (int subY = 0; subY < 8; subY++) {
          boolean subExists = RenderDetailed.isOpaque(te, subX, subY, subZ);
          if (subExists) {
            float minX = 0.125f * subX;
            float maxX = minX + 0.125f;
            float minY = 0.125f * subY;
            float maxY = minY + 0.125f;
            float minZ = 0.125f * subZ;
            float maxZ = minZ + 0.125f;

            int blockIndex = te.getIndex(subX, subY, subZ);

            int type = te.getIdFromIndex(blockIndex);
            int meta = te.getMetaFromIndex(blockIndex);

            if (type > 0) {
              int index = te.blockIndex[type];
              if (!breaking)
                ForgeHooksClient.bindTexture(
                    Block.blocksList[index].getTextureFile(),
                    ModLoader.getMinecraftInstance()
                        .renderEngine
                        .getTexture(Block.blocksList[index].getTextureFile()));

              renderblocks.setRenderMinMax(minX, minY, minZ, maxX, maxY, maxZ);
              RenderDetailed.renderStandardBlockWithColorMultiplier(
                  Block.blocksList[type], renderblocks, i, j, k, 0.95f, 0.95f, 0.95f, meta);
            }
          }
        }
      }
    }

    return true;
  }
 private void RenderMachineInInv(RenderBlocks renderer, Block block, int metadata) {
   Tessellator tesselator = Tessellator.instance;
   block.setBlockBounds(0, 0, 0, 1, 1, 1);
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderBottomFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderTopFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderEastFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderWestFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderNorthFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata));
   tesselator.draw();
   tesselator.startDrawingQuads();
   tesselator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderSouthFace(
       block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata));
   tesselator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }
 private boolean RenderMachineInWorld(
     RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block) {
   if (world.getBlockMetadata(x, y, z) < 4) {
     block.setBlockBounds(0.0F, 0.0F, 0.0F, 1F, 1F, 1F);
     renderer.renderStandardBlock(block, x, y, z);
   } else if (world.getBlockMetadata(x, y, z) == 4) {
     block.setBlockBounds(0, 0, 0, 1, 0.5f, 1);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.25f, 0.5f, 0.25f, 0.75f, 0.625f, 0.75f);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.625f, 0.625f, 0.625f, 0.375f, 1, 0.375f);
     renderer.renderStandardBlock(block, x, y, z);
   } else if (world.getBlockMetadata(x, y, z) == 5) {
     block.setBlockBounds(0, 0, 0, 1, 0.125f, 1);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.625f, .125f, 0.625f, 0.375f, 0.375f, 0.375f);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0, 0.375f, 0, 1, 0.5f, 1);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0, 0.5f, 0.875f, 1, 0.875f, 1);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0, 0.5f, 0, 1, 0.875f, 0.125f);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0, 0.5f, 0.875f, 1, 0.875f, 1);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0, 0.5f, 0.125f, 0.125f, 0.875f, 0.875f);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.875f, 0.5f, 0.125f, 1, 0.875f, 0.875f);
     renderer.renderStandardBlock(block, x, y, z);
     block.setBlockBounds(0.375f, 0.5f, 0.375f, 0.625f, 1, 0.625f);
     renderer.renderStandardBlock(block, x, y, z);
   }
   return true;
 }
  /** Method for adding special render rules */
  protected void renderSpecials(EntityPlayer par1EntityPlayer, float par2) {
    super.renderEquippedItems(par1EntityPlayer, par2);
    ItemStack itemstack = par1EntityPlayer.inventory.armorItemInSlot(3);

    if (itemstack != null && itemstack.getItem().shiftedIndex < 256) {
      GL11.glPushMatrix();
      modelBipedMain.bipedHead.postRender(0.0625F);

      if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) {
        float f = 0.625F;
        GL11.glTranslatef(0.0F, -0.25F, 0.0F);
        GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f, -f, f);
      }

      renderManager.itemRenderer.renderItem(par1EntityPlayer, itemstack, 0);
      GL11.glPopMatrix();
    }

    if (par1EntityPlayer.username.equals("deadmau5")
        && loadDownloadableImageTexture(par1EntityPlayer.skinUrl, null)) {
      for (int i = 0; i < 2; i++) {
        float f1 =
            (par1EntityPlayer.prevRotationYaw
                    + (par1EntityPlayer.rotationYaw - par1EntityPlayer.prevRotationYaw) * par2)
                - (par1EntityPlayer.prevRenderYawOffset
                    + (par1EntityPlayer.renderYawOffset - par1EntityPlayer.prevRenderYawOffset)
                        * par2);
        float f2 =
            par1EntityPlayer.prevRotationPitch
                + (par1EntityPlayer.rotationPitch - par1EntityPlayer.prevRotationPitch) * par2;
        GL11.glPushMatrix();
        GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.375F * (float) (i * 2 - 1), 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.375F, 0.0F);
        GL11.glRotatef(-f2, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
        float f7 = 1.333333F;
        GL11.glScalef(f7, f7, f7);
        modelBipedMain.renderEars(0.0625F);
        GL11.glPopMatrix();
      }
    }

    if (loadDownloadableImageTexture(par1EntityPlayer.playerCloakUrl, null)) {
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, 0.0F, 0.125F);
      double d =
          (par1EntityPlayer.field_20066_r
                  + (par1EntityPlayer.field_20063_u - par1EntityPlayer.field_20066_r)
                      * (double) par2)
              - (par1EntityPlayer.prevPosX
                  + (par1EntityPlayer.posX - par1EntityPlayer.prevPosX) * (double) par2);
      double d1 =
          (par1EntityPlayer.field_20065_s
                  + (par1EntityPlayer.field_20062_v - par1EntityPlayer.field_20065_s)
                      * (double) par2)
              - (par1EntityPlayer.prevPosY
                  + (par1EntityPlayer.posY - par1EntityPlayer.prevPosY) * (double) par2);
      double d2 =
          (par1EntityPlayer.field_20064_t
                  + (par1EntityPlayer.field_20061_w - par1EntityPlayer.field_20064_t)
                      * (double) par2)
              - (par1EntityPlayer.prevPosZ
                  + (par1EntityPlayer.posZ - par1EntityPlayer.prevPosZ) * (double) par2);
      float f10 =
          par1EntityPlayer.prevRenderYawOffset
              + (par1EntityPlayer.renderYawOffset - par1EntityPlayer.prevRenderYawOffset) * par2;
      double d3 = MathHelper.sin((f10 * (float) Math.PI) / 180F);
      double d4 = -MathHelper.cos((f10 * (float) Math.PI) / 180F);
      float f12 = (float) d1 * 10F;

      if (f12 < -6F) {
        f12 = -6F;
      }

      if (f12 > 32F) {
        f12 = 32F;
      }

      float f13 = (float) (d * d3 + d2 * d4) * 100F;
      float f14 = (float) (d * d4 - d2 * d3) * 100F;

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

      float f15 =
          par1EntityPlayer.prevCameraYaw
              + (par1EntityPlayer.cameraYaw - par1EntityPlayer.prevCameraYaw) * par2;
      f12 +=
          MathHelper.sin(
                  (par1EntityPlayer.prevDistanceWalkedModified
                          + (par1EntityPlayer.distanceWalkedModified
                                  - par1EntityPlayer.prevDistanceWalkedModified)
                              * par2)
                      * 6F)
              * 32F
              * f15;

      if (par1EntityPlayer.isSneaking()) {
        f12 += 25F;
      }

      GL11.glRotatef(6F + f13 / 2.0F + f12, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(f14 / 2.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-f14 / 2.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
      modelBipedMain.renderCloak(0.0625F);
      GL11.glPopMatrix();
    }

    ItemStack itemstack1 = par1EntityPlayer.inventory.getCurrentItem();

    if (itemstack1 != null) {
      GL11.glPushMatrix();
      modelBipedMain.bipedRightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);

      if (par1EntityPlayer.fishEntity != null) {
        itemstack1 = new ItemStack(Item.stick);
      }

      EnumAction enumaction = null;

      if (par1EntityPlayer.getItemInUseCount() > 0) {
        enumaction = itemstack1.getItemUseAction();
      }

      if (itemstack1.itemID < 256
          && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) {
        float f3 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        f3 *= 0.75F;
        GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f3, -f3, f3);
      } else if (itemstack1.itemID == Item.bow.shiftedIndex) {
        float f4 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f4, -f4, f4);
        GL11.glRotatef(-100F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      } else if (Item.itemsList[itemstack1.itemID].isFull3D()) {
        float f5 = 0.625F;

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

        if (par1EntityPlayer.getItemInUseCount() > 0 && enumaction == EnumAction.block) {
          GL11.glTranslatef(0.05F, 0.0F, -0.1F);
          GL11.glRotatef(-50F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(-60F, 0.0F, 0.0F, 1.0F);
        }

        GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
        GL11.glScalef(f5, -f5, f5);
        GL11.glRotatef(-100F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
      } else {
        float f6 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(f6, f6, f6);
        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);
      }

      if (itemstack1.getItem().func_46058_c()) {
        for (int j = 0; j <= 1; j++) {
          int k = itemstack1.getItem().getColorFromDamage(itemstack1.getItemDamage(), j);
          float f8 = (float) (k >> 16 & 0xff) / 255F;
          float f9 = (float) (k >> 8 & 0xff) / 255F;
          float f11 = (float) (k & 0xff) / 255F;
          GL11.glColor4f(f8, f9, f11, 1.0F);
          renderManager.itemRenderer.renderItem(par1EntityPlayer, itemstack1, j);
        }
      } else {
        renderManager.itemRenderer.renderItem(par1EntityPlayer, itemstack1, 0);
      }

      GL11.glPopMatrix();
    }
  }
Example #10
0
  /** Renders the item stack for being in an entity's hand Args: itemStack */
  public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) {
    GL11.glPushMatrix();

    if (par2ItemStack.itemID < 256
        && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) {
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("/terrain.png"));
      renderBlocksInstance.renderBlockAsItem(
          Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
    } else {
      if (par2ItemStack.itemID < 256) {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("/terrain.png"));
      } else {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("/gui/items.png"));
      }

      Tessellator tessellator = Tessellator.instance;
      int i = par1EntityLiving.getItemIcon(par2ItemStack, par3);
      float f = ((float) ((i % 16) * 16) + 0.0F) / 256F;
      float f1 = ((float) ((i % 16) * 16) + 15.99F) / 256F;
      float f2 = ((float) ((i / 16) * 16) + 0.0F) / 256F;
      float f3 = ((float) ((i / 16) * 16) + 15.99F) / 256F;
      float f4 = 0.0F;
      float f5 = 0.3F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glTranslatef(-f4, -f5, 0.0F);
      float f6 = 1.5F;
      GL11.glScalef(f6, f6, f6);
      GL11.glRotatef(50F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(335F, 0.0F, 0.0F, 1.0F);
      GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
      renderItemIn2D(tessellator, f1, f2, f, f3);

      if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        mc.renderEngine.bindTexture(mc.renderEngine.getTexture("%blur%/misc/glint.png"));
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float f7 = 0.76F;
        GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float f8 = 0.125F;
        GL11.glScalef(f8, f8, f8);
        float f9 = ((float) (System.currentTimeMillis() % 3000L) / 3000F) * 8F;
        GL11.glTranslatef(f9, 0.0F, 0.0F);
        GL11.glRotatef(-50F, 0.0F, 0.0F, 1.0F);
        renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(f8, f8, f8);
        f9 = ((float) (System.currentTimeMillis() % 4873L) / 4873F) * 8F;
        GL11.glTranslatef(-f9, 0.0F, 0.0F);
        GL11.glRotatef(10F, 0.0F, 0.0F, 1.0F);
        renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F);
        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);
    }

    GL11.glPopMatrix();
  }
Example #11
0
  /** Will update this chunk renderer */
  public void updateRenderer(EntityLivingBase p_147892_1_) {
    if (this.needsUpdate) {
      this.needsUpdate = false;
      int var2 = this.posX;
      int var3 = this.posY;
      int var4 = this.posZ;
      int var5 = this.posX + 16;
      int var6 = this.posY + 16;
      int var7 = this.posZ + 16;

      for (int var8 = 0; var8 < 2; ++var8) {
        this.skipRenderPass[var8] = true;
      }

      Chunk.isLit = false;
      HashSet var26 = new HashSet();
      var26.addAll(this.tileEntityRenderers);
      this.tileEntityRenderers.clear();
      Minecraft var9 = Minecraft.getMinecraft();
      EntityLivingBase var10 = var9.renderViewEntity;
      int var11 = MathHelper.floor_double(var10.posX);
      int var12 = MathHelper.floor_double(var10.posY);
      int var13 = MathHelper.floor_double(var10.posZ);
      byte var14 = 1;
      ChunkCache var15 =
          new ChunkCache(
              this.worldObj,
              var2 - var14,
              var3 - var14,
              var4 - var14,
              var5 + var14,
              var6 + var14,
              var7 + var14,
              var14);

      if (!var15.extendedLevelsInChunkCache()) {
        ++chunksUpdated;
        RenderBlocks var16 = new RenderBlocks(var15);
        this.bytesDrawn = 0;
        this.vertexState = null;

        for (int var17 = 0; var17 < 2; ++var17) {
          boolean var18 = false;
          boolean var19 = false;
          boolean var20 = false;

          for (int var21 = var3; var21 < var6; ++var21) {
            for (int var22 = var4; var22 < var7; ++var22) {
              for (int var23 = var2; var23 < var5; ++var23) {
                Block var24 = var15.getBlock(var23, var21, var22);

                if (var24.getMaterial() != Material.air) {
                  if (!var20) {
                    var20 = true;
                    this.preRenderBlocks(var17);
                  }

                  if (var17 == 0 && var24.hasTileEntity()) {
                    TileEntity var25 = var15.getTileEntity(var23, var21, var22);

                    if (TileEntityRendererDispatcher.instance.hasSpecialRenderer(var25)) {
                      this.tileEntityRenderers.add(var25);
                    }
                  }

                  int var28 = var24.getRenderBlockPass();

                  if (var28 > var17) {
                    var18 = true;
                  } else if (var28 == var17) {
                    var19 |= var16.renderBlockByRenderType(var24, var23, var21, var22);

                    if (var24.getRenderType() == 0
                        && var23 == var11
                        && var21 == var12
                        && var22 == var13) {
                      var16.setRenderFromInside(true);
                      var16.setRenderAllFaces(true);
                      var16.renderBlockByRenderType(var24, var23, var21, var22);
                      var16.setRenderFromInside(false);
                      var16.setRenderAllFaces(false);
                    }
                  }
                }
              }
            }
          }

          if (var19) {
            this.skipRenderPass[var17] = false;
          }

          if (var20) {
            this.postRenderBlocks(var17, p_147892_1_);
          } else {
            var19 = false;
          }

          if (!var18) {
            break;
          }
        }
      }

      HashSet var27 = new HashSet();
      var27.addAll(this.tileEntityRenderers);
      var27.removeAll(var26);
      this.tileEntities.addAll(var27);
      var26.removeAll(this.tileEntityRenderers);
      this.tileEntities.removeAll(var26);
      this.isChunkLit = Chunk.isLit;
      this.isInitialized = true;
    }
  }
Example #12
0
  protected void func_82411_a(EntityWitch par1EntityWitch, float par2) {
    float var3 = 1.0F;
    GL11.glColor3f(var3, var3, var3);
    super.renderEquippedItems(par1EntityWitch, par2);
    ItemStack var4 = par1EntityWitch.getHeldItem();

    if (var4 != null) {
      GL11.glPushMatrix();
      float var5;

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

      this.field_82414_a.field_82898_f.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.53125F, 0.21875F);

      if (var4.itemID < 256
          && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) {
        var5 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        var5 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(var5, -var5, var5);
      } else if (var4.itemID == Item.bow.itemID) {
        var5 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(var5, -var5, var5);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else if (Item.itemsList[var4.itemID].isFull3D()) {
        var5 = 0.625F;

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

        this.func_82410_b();
        GL11.glScalef(var5, -var5, var5);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        var5 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(var5, var5, var5);
        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);
      }

      GL11.glRotatef(-15.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F);
      this.renderManager.itemRenderer.renderItem(par1EntityWitch, var4, 0);

      if (var4.getItem().requiresMultipleRenderPasses()) {
        this.renderManager.itemRenderer.renderItem(par1EntityWitch, var4, 1);
      }

      GL11.glPopMatrix();
    }
  }
Example #13
0
  public boolean updateRenderer(long var1) {
    if (this.worldObj == null) {
      return true;
    } else {
      this.needsUpdate = false;

      if (!this.isUpdating) {
        if (this.needsBoxUpdate) {
          float var3 = 0.0F;
          GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE);
          RenderItem.renderAABB(
              AxisAlignedBB.getAABBPool()
                  .getAABB(
                      (double) ((float) this.posXClip - var3),
                      (double) ((float) this.posYClip - var3),
                      (double) ((float) this.posZClip - var3),
                      (double) ((float) (this.posXClip + 16) + var3),
                      (double) ((float) (this.posYClip + 16) + var3),
                      (double) ((float) (this.posZClip + 16) + var3)));
          GL11.glEndList();
          this.needsBoxUpdate = false;
        }

        if (Reflector.LightCache.exists()) {
          Object var25 = Reflector.getFieldValue(Reflector.LightCache_cache);
          Reflector.callVoid(var25, Reflector.LightCache_clear, new Object[0]);
          Reflector.callVoid(Reflector.BlockCoord_resetPool, new Object[0]);
        }

        Chunk.isLit = false;
      }

      int var26 = this.posX;
      int var4 = this.posY;
      int var5 = this.posZ;
      int var6 = this.posX + 16;
      int var7 = this.posY + 16;
      int var8 = this.posZ + 16;
      ChunkCache var9 = null;
      RenderBlocks var10 = null;
      HashSet var11 = null;

      if (!this.isUpdating) {
        for (int var12 = 0; var12 < 2; ++var12) {
          this.tempSkipRenderPass[var12] = true;
        }

        byte var27 = 1;
        var9 =
            new ChunkCache(
                this.worldObj,
                var26 - var27,
                var4 - var27,
                var5 - var27,
                var6 + var27,
                var7 + var27,
                var8 + var27,
                var27);
        var10 = new RenderBlocks(var9);
        var11 = new HashSet();
        var11.addAll(this.tileEntityRenderers);
        this.tileEntityRenderers.clear();
      }

      if (this.isUpdating || !var9.extendedLevelsInChunkCache()) {
        this.bytesDrawn = 0;
        Tessellator var28 = Tessellator.instance;
        boolean var13 = Reflector.ForgeHooksClient.exists();

        for (int var14 = 0; var14 < 2; ++var14) {
          boolean var15 = false;
          boolean var16 = false;
          boolean var17 = false;

          for (int var18 = var4; var18 < var7; ++var18) {
            if (this.isUpdating) {
              this.isUpdating = false;
              var9 = this.updateState.chunkcache;
              var10 = this.updateState.renderblocks;
              var11 = this.updateState.setOldEntityRenders;
              var14 = this.updateState.renderPass;
              var18 = this.updateState.y;
              var15 = this.updateState.flag;
              var16 = this.updateState.hasRenderedBlocks;
              var17 = this.updateState.hasGlList;

              if (var17) {
                GL11.glNewList(
                    this.glWorkLists[this.activeSet][var14][this.activeListIndex[var14]],
                    GL11.GL_COMPILE);
                var28.setRenderingChunk(true);
                var28.startDrawingQuads();
                var28.setTranslation(
                    (double) (-globalChunkOffsetX), 0.0D, (double) (-globalChunkOffsetZ));
              }
            } else if (var17
                && var1 != 0L
                && System.nanoTime() - var1 > 0L
                && this.activeListIndex[var14] < 15) {
              var28.draw();
              GL11.glEndList();
              var28.setRenderingChunk(false);
              var28.setTranslation(0.0D, 0.0D, 0.0D);
              ++this.activeListIndex[var14];
              this.updateState.chunkcache = var9;
              this.updateState.renderblocks = var10;
              this.updateState.setOldEntityRenders = var11;
              this.updateState.renderPass = var14;
              this.updateState.y = var18;
              this.updateState.flag = var15;
              this.updateState.hasRenderedBlocks = var16;
              this.updateState.hasGlList = var17;
              this.isUpdating = true;
              return false;
            }

            for (int var19 = var5; var19 < var8; ++var19) {
              for (int var20 = var26; var20 < var6; ++var20) {
                int var21 = var9.getBlockId(var20, var18, var19);

                if (var21 > 0) {
                  if (!var17) {
                    var17 = true;
                    GL11.glNewList(
                        this.glWorkLists[this.activeSet][var14][this.activeListIndex[var14]],
                        GL11.GL_COMPILE);
                    var28.setRenderingChunk(true);
                    var28.startDrawingQuads();
                    var28.setTranslation(
                        (double) (-globalChunkOffsetX), 0.0D, (double) (-globalChunkOffsetZ));
                  }

                  Block var22 = Block.blocksList[var21];

                  if (var14 == 0 && var22.hasTileEntity()) {
                    TileEntity var23 = var9.getBlockTileEntity(var20, var18, var19);

                    if (TileEntityRenderer.instance.hasSpecialRenderer(var23)) {
                      this.tileEntityRenderers.add(var23);
                    }
                  }

                  int var30 = var22.getRenderBlockPass();
                  boolean var24 = true;

                  if (var30 != var14) {
                    var15 = true;
                    var24 = false;
                  }

                  if (var13) {
                    var24 =
                        Reflector.callBoolean(
                            var22,
                            Reflector.ForgeBlock_canRenderInPass,
                            new Object[] {Integer.valueOf(var14)});
                  }

                  if (var24) {
                    var16 |= var10.renderBlockByRenderType(var22, var20, var18, var19);
                  }
                }
              }
            }
          }

          if (var17) {
            this.bytesDrawn += var28.draw();
            GL11.glEndList();
            var28.setRenderingChunk(false);
            var28.setTranslation(0.0D, 0.0D, 0.0D);
          } else {
            var16 = false;
          }

          if (var16) {
            this.tempSkipRenderPass[var14] = false;
          }

          if (!var15) {
            break;
          }
        }
      }

      HashSet var29 = new HashSet();
      var29.addAll(this.tileEntityRenderers);
      var29.removeAll(var11);
      this.tileEntities.addAll(var29);
      var11.removeAll(this.tileEntityRenderers);
      this.tileEntities.removeAll(var11);
      this.isChunkLit = Chunk.isLit;
      this.isInitialized = true;
      ++chunksUpdated;
      this.isVisible = true;
      this.isVisibleFromPosition = false;
      this.skipRenderPass[0] = this.tempSkipRenderPass[0];
      this.skipRenderPass[1] = this.tempSkipRenderPass[1];
      this.isUpdating = false;
      return true;
    }
  }
  /** Renders the item stack for being in an entity's hand Args: itemStack */
  public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) {
    GL11.glPushMatrix();

    Block block = null;
    if (par2ItemStack.getItem() instanceof ItemBlock
        && par2ItemStack.itemID < Block.blocksList.length) {
      block = Block.blocksList[par2ItemStack.itemID];
    }

    IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, EQUIPPED);

    if (customRenderer != null) {
      this.mc.renderEngine.bindTexture(
          par2ItemStack.getItemSpriteNumber() == 0 ? "/terrain.png" : "/gui/items.png");
      ForgeHooksClient.renderEquippedItem(
          customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack);
    } else if (block != null
        && par2ItemStack.getItemSpriteNumber() == 0
        && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) {
      this.mc.renderEngine.bindTexture("/terrain.png");
      this.renderBlocksInstance.renderBlockAsItem(
          Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
    } else {
      Icon icon = par1EntityLiving.getItemIcon(par2ItemStack, par3);

      if (icon == null) {
        GL11.glPopMatrix();
        return;
      }

      if (par2ItemStack.getItemSpriteNumber() == 0) {
        this.mc.renderEngine.bindTexture("/terrain.png");
      } else {
        this.mc.renderEngine.bindTexture("/gui/items.png");
      }

      Tessellator tessellator = Tessellator.instance;
      float f = icon.getMinU();
      float f1 = icon.getMaxU();
      float f2 = icon.getMinV();
      float f3 = icon.getMaxV();
      float f4 = 0.0F;
      float f5 = 0.3F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glTranslatef(-f4, -f5, 0.0F);
      float f6 = 1.5F;
      GL11.glScalef(f6, f6, f6);
      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);
      renderItemIn2D(
          tessellator, f1, f2, f, f3, icon.getSheetWidth(), icon.getSheetHeight(), 0.0625F);

      if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        this.mc.renderEngine.bindTexture("%blur%/misc/glint.png");
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float f7 = 0.76F;
        GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float f8 = 0.125F;
        GL11.glScalef(f8, f8, f8);
        float f9 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
        GL11.glTranslatef(f9, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(f8, f8, f8);
        f9 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
        GL11.glTranslatef(-f9, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        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);
    }

    GL11.glPopMatrix();
  }
  // Renders the look of the wall in the world
  public boolean RenderWorldBlock(
      RenderBlocks renderblocks,
      IBlockAccess iblockaccess,
      int i,
      int j,
      int k,
      Block block,
      int l) {
    BlockCobbleFence blockCobbleFence = (BlockCobbleFence) block;
    boolean flag = false;

    // Wall Constants
    float wallOffset = 0.3F;
    float wallWidth = 0.7F;
    float wallBottom = 0.0F;
    float wallHeight = 0.8F;

    float postOffset = 0.2F; // 0.375F;
    float postWidth = 0.8F; // 0.625F;
    float postHeight = 1.0F;

    // NSWE Flags for rendering additional fence pieces
    boolean west = blockCobbleFence.isWallOrGateAt(iblockaccess, i - 1, j, k);
    boolean east = blockCobbleFence.isWallOrGateAt(iblockaccess, i + 1, j, k);
    boolean south = blockCobbleFence.isWallOrGateAt(iblockaccess, i, j, k - 1);
    boolean north = blockCobbleFence.isWallOrGateAt(iblockaccess, i, j, k + 1);

    /* Couldn't make this look pretty :(
    //Render Interaction with wooden objects
    boolean otherWest = blockCobbleFence.isWoodenFenceAt(iblockaccess, i - 1, j, k);
    boolean otherEast = blockCobbleFence.isWoodenFenceAt(iblockaccess, i + 1, j, k);
    boolean otherSouth = blockCobbleFence.isWoodenFenceAt(iblockaccess, i, j, k - 1);
    boolean otherNorth = blockCobbleFence.isWoodenFenceAt(iblockaccess, i, j, k + 1);

    */

    if (north && south && !(east || west)) {
      // Render full length wall North/South
      blockCobbleFence.setBlockBounds(wallOffset, wallBottom, 0.0F, wallWidth, wallHeight, 1.0F);
      renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
    } else if (east && west && !(north || south)) {
      // Render Full length wall East/west
      blockCobbleFence.setBlockBounds(0.0F, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth);
      renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
    } else {
      // Render Center Post
      blockCobbleFence.setBlockBounds(
          postOffset, 0.0F, postOffset, postWidth, postHeight, postWidth);
      renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);

      // render West
      if (west) {
        blockCobbleFence.setBlockBounds(
            0.0F, wallBottom, wallOffset, wallWidth, wallHeight, wallWidth);
        renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
      }
      // Render East
      if (east) {
        blockCobbleFence.setBlockBounds(
            wallOffset, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth);
        renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
      }
      // Render North
      if (north) {
        blockCobbleFence.setBlockBounds(
            wallOffset, wallBottom, wallOffset, wallWidth, wallHeight, 1.0F);
        renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
      }
      // Render South
      if (south) {
        blockCobbleFence.setBlockBounds(
            wallOffset, wallBottom, 0.0F, wallWidth, wallHeight, wallWidth);
        renderblocks.renderStandardBlock(blockCobbleFence, i, j, k);
      }
    }

    blockCobbleFence.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    return true;
  }
Example #16
0
  /** Renders the item stack for being in an entity's hand Args: itemStack */
  public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) {
    GL11.glPushMatrix();
    Block var4 = null;

    if (par2ItemStack.itemID < Block.blocksList.length) {
      var4 = Block.blocksList[par2ItemStack.itemID];
    }

    if (var4 != null && RenderBlocks.renderItemIn3d(var4.getRenderType())) {
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
      this.renderBlocksInstance.renderBlockAsItem(var4, par2ItemStack.getItemDamage(), 1.0F);
    } else {
      if (var4 != null) {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
      } else {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
      }

      Tessellator var5 = Tessellator.instance;
      int var6 = par1EntityLiving.getItemIcon(par2ItemStack, par3);
      float var7 = ((float) (var6 % 16 * 16) + 0.0F) / 256.0F;
      float var8 = ((float) (var6 % 16 * 16) + 15.99F) / 256.0F;
      float var9 = ((float) (var6 / 16 * 16) + 0.0F) / 256.0F;
      float var10 = ((float) (var6 / 16 * 16) + 15.99F) / 256.0F;
      float var11 = 0.0F;
      float var12 = 0.3F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glTranslatef(-var11, -var12, 0.0F);
      float var13 = 1.5F;
      GL11.glScalef(var13, var13, var13);
      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);
      renderItemIn2D(var5, var8, var9, var7, var10, 0.0625F);

      if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("%blur%/misc/glint.png"));
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float var14 = 0.76F;
        GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float var15 = 0.125F;
        GL11.glScalef(var15, var15, var15);
        float var16 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
        GL11.glTranslatef(var16, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(var15, var15, var15);
        var16 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
        GL11.glTranslatef(-var16, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 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);
    }

    GL11.glPopMatrix();
  }
Example #17
0
  /** Method for adding special render rules */
  protected void renderSpecials(EntityPlayer par1EntityPlayer, float par2) {
    float var3 = 1.0F;
    GL11.glColor3f(var3, var3, var3);
    super.renderEquippedItems(par1EntityPlayer, par2);
    super.renderArrowsStuckInEntity(par1EntityPlayer, par2);
    ItemStack var4 = par1EntityPlayer.inventory.armorItemInSlot(3);

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

      if (var4.getItem().itemID < 256) {
        if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) {
          var5 = 0.625F;
          GL11.glTranslatef(0.0F, -0.25F, 0.0F);
          GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
          GL11.glScalef(var5, -var5, -var5);
        }

        this.renderManager.itemRenderer.renderItem(par1EntityPlayer, var4, 0);
      } else if (var4.getItem().itemID == Item.skull.itemID) {
        var5 = 1.0625F;
        GL11.glScalef(var5, -var5, -var5);
        String var6 = "";

        if (var4.hasTagCompound() && var4.getTagCompound().hasKey("SkullOwner")) {
          var6 = var4.getTagCompound().getString("SkullOwner");
        }

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

      GL11.glPopMatrix();
    }

    if (!par1EntityPlayer.getHasActivePotion()) {
      AccessoryHandler.renderAllAccessories(par1EntityPlayer, 0.0625F, par2); // Spout
    }

    float var7;
    float var8;

    if (par1EntityPlayer.username.equals("deadmau5")
        && this.loadDownloadableImageTexture(par1EntityPlayer.skinUrl, (String) null)) {
      for (int var20 = 0; var20 < 2; ++var20) {
        float var25 =
            par1EntityPlayer.prevRotationYaw
                + (par1EntityPlayer.rotationYaw - par1EntityPlayer.prevRotationYaw) * par2
                - (par1EntityPlayer.prevRenderYawOffset
                    + (par1EntityPlayer.renderYawOffset - par1EntityPlayer.prevRenderYawOffset)
                        * par2);
        var7 =
            par1EntityPlayer.prevRotationPitch
                + (par1EntityPlayer.rotationPitch - par1EntityPlayer.prevRotationPitch) * par2;
        GL11.glPushMatrix();
        GL11.glRotatef(var25, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(var7, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.375F * (float) (var20 * 2 - 1), 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.375F, 0.0F);
        GL11.glRotatef(-var7, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-var25, 0.0F, 1.0F, 0.0F);
        var8 = 1.3333334F;
        GL11.glScalef(var8, var8, var8);
        this.modelBipedMain.renderEars(0.0625F);
        GL11.glPopMatrix();
      }
    }

    float var11;

    if (this.loadDownloadableImageTexture(par1EntityPlayer.playerCloakUrl, (String) null)
        && !par1EntityPlayer.getHasActivePotion()
        && !par1EntityPlayer.getHideCape()) {
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, 0.0F, 0.125F);
      double var22 =
          par1EntityPlayer.field_71091_bM
              + (par1EntityPlayer.field_71094_bP - par1EntityPlayer.field_71091_bM) * (double) par2
              - (par1EntityPlayer.prevPosX
                  + (par1EntityPlayer.posX - par1EntityPlayer.prevPosX) * (double) par2);
      double var24 =
          par1EntityPlayer.field_71096_bN
              + (par1EntityPlayer.field_71095_bQ - par1EntityPlayer.field_71096_bN) * (double) par2
              - (par1EntityPlayer.prevPosY
                  + (par1EntityPlayer.posY - par1EntityPlayer.prevPosY) * (double) par2);
      double var9 =
          par1EntityPlayer.field_71097_bO
              + (par1EntityPlayer.field_71085_bR - par1EntityPlayer.field_71097_bO) * (double) par2
              - (par1EntityPlayer.prevPosZ
                  + (par1EntityPlayer.posZ - par1EntityPlayer.prevPosZ) * (double) par2);
      var11 =
          par1EntityPlayer.prevRenderYawOffset
              + (par1EntityPlayer.renderYawOffset - par1EntityPlayer.prevRenderYawOffset) * par2;
      double var12 = (double) MathHelper.sin(var11 * (float) Math.PI / 180.0F);
      double var14 = (double) (-MathHelper.cos(var11 * (float) Math.PI / 180.0F));
      float var16 = (float) var24 * 10.0F;

      if (var16 < -6.0F) {
        var16 = -6.0F;
      }

      if (var16 > 32.0F) {
        var16 = 32.0F;
      }

      float var17 = (float) (var22 * var12 + var9 * var14) * 100.0F;
      float var18 = (float) (var22 * var14 - var9 * var12) * 100.0F;

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

      float var19 =
          par1EntityPlayer.prevCameraYaw
              + (par1EntityPlayer.cameraYaw - par1EntityPlayer.prevCameraYaw) * par2;
      var16 +=
          MathHelper.sin(
                  (par1EntityPlayer.prevDistanceWalkedModified
                          + (par1EntityPlayer.distanceWalkedModified
                                  - par1EntityPlayer.prevDistanceWalkedModified)
                              * par2)
                      * 6.0F)
              * 32.0F
              * var19;

      if (par1EntityPlayer.isSneaking()) {
        var16 += 25.0F;
      }

      GL11.glRotatef(6.0F + var17 / 2.0F + var16, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(var18 / 2.0F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(-var18 / 2.0F, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      this.modelBipedMain.renderCloak(0.0625F);
      GL11.glPopMatrix();
    }

    ItemStack var21 = par1EntityPlayer.inventory.getCurrentItem();

    if (var21 != null) {
      GL11.glPushMatrix();
      this.modelBipedMain.bipedRightArm.postRender(0.0625F);
      GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);

      if (par1EntityPlayer.fishEntity != null) {
        var21 = new ItemStack(Item.stick);
      }

      EnumAction var23 = null;

      if (par1EntityPlayer.getItemInUseCount() > 0) {
        var23 = var21.getItemUseAction();
      }

      if (var21.itemID < 256
          && RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType())) {
        var7 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        var7 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-var7, -var7, var7);
      } else if (var21.itemID == Item.bow.itemID) {
        var7 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(var7, -var7, var7);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        // Spout Start
      } else if (Item.itemsList[var21.itemID].isFull3D()
          || var21.itemID == Item.flint.itemID
              && MaterialData.getCustomItem(var21.getItemDamage())
                  instanceof org.spoutcraft.api.material.Tool) {
        // Spout End
        var7 = 0.625F;

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

        if (par1EntityPlayer.getItemInUseCount() > 0 && var23 == EnumAction.block) {
          GL11.glTranslatef(0.05F, 0.0F, -0.1F);
          GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F);
          GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F);
        }

        GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
        GL11.glScalef(var7, -var7, var7);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      } else {
        var7 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(var7, var7, var7);
        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 var10;
      int var27;
      float var28;

      if (var21.getItem().requiresMultipleRenderPasses()) {
        for (var27 = 0; var27 <= 1; ++var27) {
          int var26 = var21.getItem().getColorFromItemStack(var21, var27);
          var28 = (float) (var26 >> 16 & 255) / 255.0F;
          var10 = (float) (var26 >> 8 & 255) / 255.0F;
          var11 = (float) (var26 & 255) / 255.0F;
          GL11.glColor4f(var28, var10, var11, 1.0F);
          this.renderManager.itemRenderer.renderItem(par1EntityPlayer, var21, var27);
        }
      } else {
        var27 = var21.getItem().getColorFromItemStack(var21, 0);
        var8 = (float) (var27 >> 16 & 255) / 255.0F;
        var28 = (float) (var27 >> 8 & 255) / 255.0F;
        var10 = (float) (var27 & 255) / 255.0F;
        GL11.glColor4f(var8, var28, var10, 1.0F);
        this.renderManager.itemRenderer.renderItem(par1EntityPlayer, var21, 0);
      }

      GL11.glPopMatrix();
    }
  }
Example #18
0
  public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) {
    GL11.glPushMatrix();
    // Spout Start
    boolean custom = false;
    BlockDesign design = null;
    if (par2ItemStack.itemID == 318) {
      org.spoutcraft.spoutcraftapi.material.CustomItem item =
          MaterialData.getCustomItem(par2ItemStack.getItemDamage());
      if (item != null) {
        String textureURI = item.getTexture();
        if (textureURI == null) {
          org.spoutcraft.spoutcraftapi.material.CustomBlock block =
              MaterialData.getCustomBlock(par2ItemStack.getItemDamage());
          design = block != null ? block.getBlockDesign() : null;
          textureURI = design != null ? design.getTexureURL() : null;
        }
        if (textureURI != null) {
          Texture texture =
              CustomTextureManager.getTextureFromUrl(
                  item.getAddon().getDescription().getName(), textureURI);
          if (texture != null) {
            GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getTextureID());
            custom = true;
          }
        }
      }
    }

    if (!custom) {
      if (par2ItemStack.itemID < 256) {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
      } else {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
      }
    }

    if (design != null) {
      design.renderItemstack(null, -0.5F, -0.5F, -0.5F, 0, 1F, rand);
    } else if (par2ItemStack.itemID < 256
        && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) {
      this.renderBlocksInstance.renderBlockAsItem(
          Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
    } else {

      Tessellator var4 = Tessellator.instance;
      int var5 = par1EntityLiving.getItemIcon(par2ItemStack, par3);
      float var6 = ((float) (var5 % 16 * TileSize.int_size) + 0.0F) / TileSize.float_size16;
      float var7 =
          ((float) (var5 % 16 * TileSize.int_size) + TileSize.float_sizeMinus0_01)
              / TileSize.float_size16;
      float var8 = ((float) (var5 / 16 * TileSize.int_size) + 0.0F) / TileSize.float_size16;
      float var9 =
          ((float) (var5 / 16 * TileSize.int_size) + TileSize.float_sizeMinus0_01)
              / TileSize.float_size16;

      if (custom) {
        var6 = 0;
        var7 = 1;
        var8 = 1;
        var9 = 0;
      }
      // Spout end
      float var10 = 0.0F;
      float var11 = 0.3F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glTranslatef(-var10, -var11, 0.0F);
      float var12 = 1.5F;
      GL11.glScalef(var12, var12, var12);
      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);
      Colorizer.colorizeWaterBlockGL(par2ItemStack.itemID); // Spout HD
      this.renderItemIn2D(var4, var7, var8, var6, var9);
      if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("%blur%/misc/glint.png"));
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float var13 = 0.76F;
        GL11.glColor4f(0.5F * var13, 0.25F * var13, 0.8F * var13, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float var14 = 0.125F;
        GL11.glScalef(var14, var14, var14);
        float var15 = (float) (System.currentTimeMillis() % 3000L) / 3000.0F * 8.0F;
        GL11.glTranslatef(var15, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        this.renderItemIn2D(var4, 0.0F, 0.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(var14, var14, var14);
        var15 = (float) (System.currentTimeMillis() % 4873L) / 4873.0F * 8.0F;
        GL11.glTranslatef(-var15, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        this.renderItemIn2D(var4, 0.0F, 0.0F, 1.0F, 1.0F);
        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);
    }

    GL11.glPopMatrix();
  }
  public void func_1198_a() {
    if (!field_1738_u) {
      return;
    }
    field_1762_b++;
    int i = field_1761_c;
    int j = field_1760_d;
    int k = field_1759_e;
    int l = field_1761_c + field_1758_f;
    int i1 = field_1760_d + field_1757_g;
    int j1 = field_1759_e + field_1756_h;
    for (int k1 = 0; k1 < 2; k1++) {
      field_1748_p[k1] = true;
    }

    Chunk.field_1540_a = false;
    HashSet hashset = new HashSet();
    hashset.addAll(field_1745_B);
    field_1745_B.clear();
    int l1 = 1;
    ChunkCache chunkcache =
        new ChunkCache(field_1763_a, i - l1, j - l1, k - l1, l + l1, i1 + l1, j1 + l1);
    RenderBlocks renderblocks = new RenderBlocks(chunkcache);
    field_40590_G = 0;
    int i2 = 0;
    do {
      if (i2 >= 2) {
        break;
      }
      boolean flag = false;
      boolean flag1 = false;
      boolean flag2 = false;
      for (int j2 = j; j2 < i1; j2++) {
        for (int k2 = k; k2 < j1; k2++) {
          for (int l2 = i; l2 < l; l2++) {
            int i3 = chunkcache.func_600_a(l2, j2, k2);
            if (i3 <= 0) {
              continue;
            }
            if (!flag2) {
              flag2 = true;
              GL11.glNewList(field_1744_C + i2, 4864);
              GL11.glPushMatrix();
              func_1203_g();
              float f = 1.000001F;
              GL11.glTranslatef(
                  (float) (-field_1756_h) / 2.0F,
                  (float) (-field_1757_g) / 2.0F,
                  (float) (-field_1756_h) / 2.0F);
              GL11.glScalef(f, f, f);
              GL11.glTranslatef(
                  (float) field_1756_h / 2.0F,
                  (float) field_1757_g / 2.0F,
                  (float) field_1756_h / 2.0F);
              field_1742_D.func_977_b();
              field_1742_D.func_984_b(-field_1761_c, -field_1760_d, -field_1759_e);
            }
            if (i2 == 0 && Block.field_342_q[i3]) {
              TileEntity tileentity = chunkcache.func_603_b(l2, j2, k2);
              if (TileEntityRenderer.field_1554_a.func_1028_a(tileentity)) {
                field_1745_B.add(tileentity);
              }
            }
            Block block = Block.field_345_n[i3];
            int j3 = block.func_234_g();
            if (i2 == 0 && renderblocks.func_35927_a(l2, j2, k2, i2)) {
              flag1 = true;
            }
            if (j3 != i2) {
              flag = true;
              continue;
            }
            if (j3 == i2) {
              flag1 |= renderblocks.func_1234_a(block, l2, j2, k2);
            }
          }
        }
      }

      if (flag2) {
        field_40590_G += field_1742_D.func_982_a();
        GL11.glPopMatrix();
        GL11.glEndList();
        field_1742_D.func_984_b(0.0D, 0.0D, 0.0D);
      } else {
        flag1 = false;
      }
      if (flag1) {
        field_1748_p[i2] = false;
      }
      if (!flag) {
        break;
      }
      i2++;
    } while (true);
    HashSet hashset1 = new HashSet();
    hashset1.addAll(field_1745_B);
    hashset1.removeAll(hashset);
    field_1737_F.addAll(hashset1);
    hashset.removeAll(field_1745_B);
    field_1737_F.removeAll(hashset);
    field_1747_A = Chunk.field_1540_a;
    field_1739_E = true;
  }
 public void func_78443_a(EntityLiving p_78443_1_, ItemStack p_78443_2_, int p_78443_3_) {
   GL11.glPushMatrix();
   Block block = null;
   if (p_78443_2_.field_77993_c < Block.field_71973_m.length) {
     block = Block.field_71973_m[p_78443_2_.field_77993_c];
   }
   if (block != null && RenderBlocks.func_78597_b(block.func_71857_b())) {
     GL11.glBindTexture(3553, field_78455_a.field_71446_o.func_78341_b("/terrain.png"));
     field_78452_e.func_78600_a(block, p_78443_2_.func_77960_j(), 1.0F);
   } else {
     if (block != null) {
       GL11.glBindTexture(3553, field_78455_a.field_71446_o.func_78341_b("/terrain.png"));
     } else {
       GL11.glBindTexture(3553, field_78455_a.field_71446_o.func_78341_b("/gui/items.png"));
     }
     Tessellator tessellator = Tessellator.field_78398_a;
     int i = p_78443_1_.func_70620_b(p_78443_2_, p_78443_3_);
     float f = ((float) ((i % 16) * 16) + 0.0F) / 256F;
     float f1 = ((float) ((i % 16) * 16) + 15.99F) / 256F;
     float f2 = ((float) ((i / 16) * 16) + 0.0F) / 256F;
     float f3 = ((float) ((i / 16) * 16) + 15.99F) / 256F;
     float f4 = 0.0F;
     float f5 = 0.3F;
     GL11.glEnable(32826);
     GL11.glTranslatef(-f4, -f5, 0.0F);
     float f6 = 1.5F;
     GL11.glScalef(f6, f6, f6);
     GL11.glRotatef(50F, 0.0F, 1.0F, 0.0F);
     GL11.glRotatef(335F, 0.0F, 0.0F, 1.0F);
     GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
     func_78439_a(tessellator, f1, f2, f, f3);
     if (p_78443_2_ != null && p_78443_2_.func_77962_s() && p_78443_3_ == 0) {
       GL11.glDepthFunc(514);
       GL11.glDisable(2896);
       field_78455_a.field_71446_o.func_78342_b(
           field_78455_a.field_71446_o.func_78341_b("%blur%/misc/glint.png"));
       GL11.glEnable(3042);
       GL11.glBlendFunc(768, 1);
       float f7 = 0.76F;
       GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
       GL11.glMatrixMode(5890);
       GL11.glPushMatrix();
       float f8 = 0.125F;
       GL11.glScalef(f8, f8, f8);
       float f9 = ((float) (Minecraft.func_71386_F() % 3000L) / 3000F) * 8F;
       GL11.glTranslatef(f9, 0.0F, 0.0F);
       GL11.glRotatef(-50F, 0.0F, 0.0F, 1.0F);
       func_78439_a(tessellator, 0.0F, 0.0F, 1.0F, 1.0F);
       GL11.glPopMatrix();
       GL11.glPushMatrix();
       GL11.glScalef(f8, f8, f8);
       f9 = ((float) (Minecraft.func_71386_F() % 4873L) / 4873F) * 8F;
       GL11.glTranslatef(-f9, 0.0F, 0.0F);
       GL11.glRotatef(10F, 0.0F, 0.0F, 1.0F);
       func_78439_a(tessellator, 0.0F, 0.0F, 1.0F, 1.0F);
       GL11.glPopMatrix();
       GL11.glMatrixMode(5888);
       GL11.glDisable(3042);
       GL11.glEnable(2896);
       GL11.glDepthFunc(515);
     }
     GL11.glDisable(32826);
   }
   GL11.glPopMatrix();
 }