    001package net.minecraft.client.gui.inventory;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.entity.player.InventoryPlayer;
    006import net.minecraft.inventory.ContainerFurnace;
    007import net.minecraft.tileentity.TileEntityFurnace;
    008import net.minecraft.util.StatCollector;
    009import org.lwjgl.opengl.GL11;
    010
    011@SideOnly(Side.CLIENT)
    012public class GuiFurnace extends GuiContainer
    013{
    014    private TileEntityFurnace furnaceInventory;
    015
    016    public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace)
    017    {
    018        super(new ContainerFurnace(par1InventoryPlayer, par2TileEntityFurnace));
    019        this.furnaceInventory = par2TileEntityFurnace;
    020    }
    021
    022    /**
    023     * Draw the foreground layer for the GuiContainer (everything in front of the items)
    024     */
    025    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    026    {
    027        String s = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : StatCollector.translateToLocal(this.furnaceInventory.getInvName());
    028        this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
    029        this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
    030    }
    031
    032    /**
    033     * Draw the background layer for the GuiContainer (everything behind the items)
    034     */
    035    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    036    {
    037        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    038        this.mc.renderEngine.bindTexture("/gui/furnace.png");
    039        int k = (this.width - this.xSize) / 2;
    040        int l = (this.height - this.ySize) / 2;
    041        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    042        int i1;
    043
    044        if (this.furnaceInventory.isBurning())
    045        {
    046            i1 = this.furnaceInventory.getBurnTimeRemainingScaled(12);
    047            this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
    048        }
    049
    050        i1 = this.furnaceInventory.getCookProgressScaled(24);
    051        this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
    052    }
    053}