/** Draw the background layer for the GuiContainer (everything behind the items) */
  @Override
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
    super.drawGuiContainerBackgroundLayer(par1, par2, par3);

    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;

    int i1 = ext.getCookProgressScaled(32, 0);
    int i2 = ext.getCookProgressScaled(28, 1);
    int i3 = ext.getCookProgressScaled(28, 2);
    int i4 = ext.getCookProgressScaled(32, 3);
    this.drawTexturedModalRect(j + 29, k + 34, 176, 48, 10, i1);
    this.drawTexturedModalRect(j + 63, k + 35, 186, 48, 14, i2);
    this.drawTexturedModalRect(j + 99, k + 35, 200, 48, 14, i3);
    this.drawTexturedModalRect(j + 133, k + 49 - i4, 176, 79 - i4, 17, i4);
  }
  /** Renders the TileEntity for the position. */
  public void renderTileEntityExtractorAt(
      TileEntityExtractor tile, double par2, double par4, double par6, float par8) {
    int var9;

    if (!tile.isInWorld()) var9 = 0;
    else var9 = tile.getBlockMetadata();

    ModelExtractor var14;
    var14 = ExtractorModel;

    this.bindTextureByName("/Reika/RotaryCraft/Textures/TileEntityTex/extractortex.png");

    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    if (tile.isInWorld() && MinecraftForgeClient.getRenderPass() == 1) GL11.glEnable(GL11.GL_BLEND);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glTranslatef((float) par2, (float) par4 + 2.0F, (float) par6 + 1.0F);
    GL11.glScalef(1.0F, -1.0F, -1.0F);
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    int var11 = 0; // used to rotate the model about metadata

    if (tile.isInWorld()) {

      switch (tile.getBlockMetadata()) {
        case 0:
          var11 = 0;
          break;
        case 1:
          var11 = 180;
          break;
        case 2:
          var11 = 270;
          break;
        case 3:
          var11 = 90;
          break;
      }

      if (tile.getBlockMetadata() <= 3) GL11.glRotatef((float) var11 + 90, 0.0F, 1.0F, 0.0F);
      else {
        GL11.glRotatef(var11, 1F, 0F, 0.0F);
        GL11.glTranslatef(0F, -1F, 1F);
        if (tile.getBlockMetadata() == 5) GL11.glTranslatef(0F, 0F, -2F);
      }
    }

    var14.renderAll(
        tile, ReikaJavaLibrary.makeListFrom(MinecraftForgeClient.getRenderPass() == 1), 0, 0);

    if (tile.isInWorld()) GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  }