public interface GuiIDs {
    int GUI_NMJ = 0;
    int GUI_PDG = 1;
    int GUI_Guo = 2;
    int GUI_Gyg = 3;
    int GUI_Caiban = 4;
    int GUI_YZJ = 5;
    int GUI_Nt = 6;
    int GUI_Zl = 7;
    int GUI_Tpj = 8;
} public class ContainerBeverageMaking extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityBeverageMaking furnaceIn;
    private int lastWater;
    private int lastcurrentItemcoldBurnTime;
    private int lastcoldBurnTime;
    private int lastmilk;

    public ContainerBeverageMaking(InventoryPlayer par1InventoryPlayer, TileEntityBeverageMaking tileEntityTpj) {
        this.furnaceIn = tileEntityTpj;
        this.addSlotToContainer(new Slot(tileEntityTpj, 0, 37, 59));
        this.addSlotToContainer(new Slot(tileEntityTpj, 1, 37, 31));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityTpj, 2, 85, 31));
        this.addSlotToContainer(new Slot(tileEntityTpj, 3, 118, 20));
        this.addSlotToContainer(new Slot(tileEntityTpj, 4, 118, 52));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
        par1ICrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.currentItemcoldBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.coldBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.milk);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }

        if (par1 == 3) {
            this.furnaceIn.water = par2;
        }

        if (par1 == 4) {
            this.furnaceIn.currentItemcoldBurnTime = par2;
        }

        if (par1 == 5) {
            this.furnaceIn.coldBurnTime = par2;
        }

        if (par1 == 6) {
            this.furnaceIn.milk = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();
        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastWater != this.furnaceIn.water) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
            }

            if (this.lastcurrentItemcoldBurnTime != this.furnaceIn.currentItemcoldBurnTime) {
                icrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.currentItemcoldBurnTime);
            }

            if (this.lastcoldBurnTime != this.furnaceIn.coldBurnTime) {
                icrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.coldBurnTime);
            }

            if (this.lastmilk != this.furnaceIn.milk) {
                icrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.milk);
            }
        }

        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastWater = this.furnaceIn.water;
        this.lastcurrentItemcoldBurnTime = this.furnaceIn.currentItemcoldBurnTime;
        this.lastcoldBurnTime = this.furnaceIn.coldBurnTime;
        this.lastmilk = this.furnaceIn.milk;
    }

    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerBrewBarrel extends ContainerFoodcraft {
    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityBrewBarrel furnaceIn;
    private int lastWater;
    public ContainerBrewBarrel(InventoryPlayer par1InventoryPlayer, TileEntityBrewBarrel tileEntityNt) {
        this.furnaceIn = tileEntityNt;
        this.addSlotToContainer(new Slot(tileEntityNt, 0, 54, 32));
        this.addSlotToContainer(new Slot(tileEntityNt, 1, 78, 32));
        this.addSlotToContainer(new Slot(tileEntityNt, 2, 101, 32));
        this.addSlotToContainer(new Slot(tileEntityNt, 3, 37, 59));
        this.addSlotToContainer(new Slot(tileEntityNt, 4, 138, 32));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityNt, 5, 138, 59));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }
        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }
        if (par1 == 3) {
            this.furnaceIn.water = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();
        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);
            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }
            if (this.lastWater != this.furnaceIn.water) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
            }
        }
        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastWater = this.furnaceIn.water;
    }

    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerChoppingBoard extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityChoppingBoard furnaceIn;

    public ContainerChoppingBoard(InventoryPlayer par1InventoryPlayer, TileEntityChoppingBoard tileEntityCaiban) {

        this.furnaceIn = tileEntityCaiban;

        this.addSlotToContainer(new Slot(tileEntityCaiban, 0, 31, 26));
        this.addSlotToContainer(new Slot(tileEntityCaiban, 1, 70, 26));
        this.addSlotToContainer(new Slot(tileEntityCaiban, 2, 97, 26));
        this.addSlotToContainer(new Slot(tileEntityCaiban, 3, 124, 26));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityCaiban, 4, 97, 58));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
    }

    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerFrying extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityFrying furnaceIn;
    private int lastWater;

    public ContainerFrying(InventoryPlayer par1InventoryPlayer, TileEntityFrying tileEntityYZJ) {
        this.furnaceIn = tileEntityYZJ;
        this.addSlotToContainer(new Slot(tileEntityYZJ, 0, 58, 31));
        this.addSlotToContainer(new Slot(tileEntityYZJ, 1, 95, 60));
        this.addSlotToContainer(new Slot(tileEntityYZJ, 2, 37, 59));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityYZJ, 3, 130, 31));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }

        if (par1 == 3) {
            this.furnaceIn.water = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();
        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastWater != this.furnaceIn.water) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
            }
        }

        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastWater = this.furnaceIn.water;
    }


    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerMill extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityMill furnaceIn;

    public ContainerMill(InventoryPlayer par1InventoryPlayer, TileEntityMill furnaceInv) {
        this.furnaceIn = furnaceInv;
        this.addSlotToContainer(new Slot(furnaceInv, 0, 49, 19));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, furnaceInv, 1, 112, 19));
        this.addSlotToContainer(new Slot(furnaceInv, 2, 80, 54));
        int var3;

        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {

        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();

        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }
        }
        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
    }


    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        ItemStack var3 = null;
        Slot var4 = (Slot)this.inventorySlots.get(par2);
        if (var4 != null && var4.getHasStack()) {
            ItemStack var5 = var4.getStack();
            var3 = var5.copy();
            if (par2 >= 0 && par2 <= 2) {
                if (!this.mergeItemStack(var5, 3, 30, false)) {
                    return null;
                }
                var4.onSlotChange(var5, var3);
            } else if (par2 > 3 && par2 < 30) {
                if (!this.mergeItemStack(var5, 30, 39, false)) {
                    return null;
                }
            } else if (par2 >= 30 && par2 < 39) {
                if (!this.mergeItemStack(var5, 3, 30, false)) {
                    return null;
                }
            }
            if (var5.stackSize == 0) {
                var4.putStack((ItemStack)null);
            } else {
                var4.onSlotChanged();
            }
            if (var5.stackSize == var3.stackSize) {
                return null;
            }
            var4.onPickupFromSlot(par1EntityPlayer, var5);
        }
        return var3;

    }
} public class ContainerPan extends ContainerFoodcraft {

    private int lastfrequencyOfUse;
    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityPan furnaceIn;
    private int lastNowheat;
    private int lastMax;
    private int lastMin;

    public ContainerPan(InventoryPlayer par1InventoryPlayer, TileEntityPan furnaceInv) {
        this.furnaceIn = furnaceInv;
        this.addSlotToContainer(new Slot(furnaceInv, 0, 45, 39));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, furnaceInv, 1, 108, 39));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, furnaceInv, 2, 137, 39));
        this.addSlotToContainer(new Slot(furnaceInv, 3, 18, 39));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.frequencyOfUse);
        par1ICrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.Nowheat);
        par1ICrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.min);
        par1ICrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.max);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }

        if (par1 == 3) {
            this.furnaceIn.frequencyOfUse = par2;
        }

        if (par1 == 4) {
            this.furnaceIn.Nowheat = par2;
        }

        if (par1 == 5) {
            this.furnaceIn.min = par2;
        }

        if (par1 == 6) {
            this.furnaceIn.max = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();
        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastfrequencyOfUse != this.furnaceIn.frequencyOfUse) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.frequencyOfUse);
            }

            if (this.lastNowheat != this.furnaceIn.Nowheat) {
                icrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.Nowheat);
            }

            if (this.lastMin != this.furnaceIn.min) {
                icrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.min);
            }

            if (this.lastMax != this.furnaceIn.max) {
                icrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.max);
            }
        }
        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastfrequencyOfUse = this.furnaceIn.frequencyOfUse;
        lastNowheat = this.furnaceIn.Nowheat;
        lastMin = this.furnaceIn.min;
        lastMax = this.furnaceIn.max;
    }


    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerPot extends ContainerFoodcraft {

    private int lastNowheat;
    private int lastMax;
    private int lastMin;
    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityPot furnaceIn;
    private int lastAngles;
    private int lastfrequencyOfUse;

    public ContainerPot(InventoryPlayer par1InventoryPlayer, TileEntityPot tileEntityGuo) {
        this.furnaceIn = tileEntityGuo;

        this.addSlotToContainer(new Slot(tileEntityGuo, 0, 17, 19));
        this.addSlotToContainer(new Slot(tileEntityGuo, 1, 35, 19));
        this.addSlotToContainer(new Slot(tileEntityGuo, 2, 53, 19));
        this.addSlotToContainer(new Slot(tileEntityGuo, 3, 71, 19));
        this.addSlotToContainer(new Slot(tileEntityGuo, 4, 17, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 5, 35, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 6, 53, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 7, 71, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 8, 89, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 9, 107, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 10, 125, 45));
        this.addSlotToContainer(new Slot(tileEntityGuo, 11, 143, 45));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityGuo, 12, 125, 19));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityGuo, 13, 143, 19));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }
        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.frequencyOfUse);
        par1ICrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.Nowheat);
        par1ICrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.min);
        par1ICrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.max);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }
        if (par1 == 3) {
            this.furnaceIn.frequencyOfUse = par2;
        }
        if (par1 == 4) {
            this.furnaceIn.Nowheat = par2;
        }
        if (par1 == 5) {
            this.furnaceIn.min = par2;
        }
        if (par1 == 6) {
            this.furnaceIn.max = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();
        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastfrequencyOfUse != this.furnaceIn.frequencyOfUse) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.frequencyOfUse);
            }

            if (this.lastNowheat != this.furnaceIn.Nowheat) {
                icrafting.sendProgressBarUpdate(this, 4, this.furnaceIn.Nowheat);
            }

            if (this.lastMin != this.furnaceIn.min) {
                icrafting.sendProgressBarUpdate(this, 5, this.furnaceIn.min);
            }

            if (this.lastMax != this.furnaceIn.max) {
                icrafting.sendProgressBarUpdate(this, 6, this.furnaceIn.max);
            }
        }

        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastfrequencyOfUse = this.furnaceIn.frequencyOfUse;
        lastNowheat = this.furnaceIn.Nowheat;
        lastMin = this.furnaceIn.min;
        lastMax = this.furnaceIn.max;
    }


    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerPressureCooker extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityPressureCooker furnaceIn;
    private int lastWater;

    public ContainerPressureCooker(InventoryPlayer par1InventoryPlayer, TileEntityPressureCooker tileEntityGyg) {

        this.furnaceIn = tileEntityGyg;
        this.addSlotToContainer(new Slot(tileEntityGyg, 0, 47, 31));
        this.addSlotToContainer(new Slot(tileEntityGyg, 1, 71, 31));
        this.addSlotToContainer(new Slot(tileEntityGyg, 2, 95, 31));
        this.addSlotToContainer(new Slot(tileEntityGyg, 3, 37, 59));
        this.addSlotToContainer(new Slot(tileEntityGyg, 4, 95, 59));
        this.addSlotToContainer(new SlotFurnaceOutput(par1InventoryPlayer.player, tileEntityGyg, 5, 145, 31));
        int var3;

        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }
        if (par1 == 3) {
            this.furnaceIn.water = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();

        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastWater != this.furnaceIn.water) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
            }
        }
        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastWater = this.furnaceIn.water;
    }

    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class ContainerStove extends ContainerFoodcraft {

    private int lastCookTime;
    private int lastBurnTime;
    private int lastItemBurnTime;
    private TileEntityStove furnaceIn;
    private int lastWater;

    public ContainerStove(InventoryPlayer par1InventoryPlayer, TileEntityStove tileEntityZl) {
        this.furnaceIn = tileEntityZl;
        this.addSlotToContainer(new Slot(tileEntityZl, 0, 80,54));
        int var3;
        for (var3 = 0; var3 < 3; ++var3) {
            for (int var4 = 0; var4 < 9; ++var4) {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }

        for (var3 = 0; var3 < 9; ++var3) {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
    }

    public void onCraftGuiOpened(ICrafting par1ICrafting) {
        super.onCraftGuiOpened(par1ICrafting);
        par1ICrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
        par1ICrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
        par1ICrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
    }

    @SideOnly(Side.CLIENT)
    public void updateProgressBar(int par1, int par2) {
        if (par1 == 0) {
            this.furnaceIn.furnaceCookTime = par2;
        }

        if (par1 == 1) {
            this.furnaceIn.tableBurnTime = par2;
        }

        if (par1 == 2) {
            this.furnaceIn.currentItemBurnTime = par2;
        }
        if (par1 == 3) {
            this.furnaceIn.water = par2;
        }
    }

    public void detectAndSendChanges() {
        super.detectAndSendChanges();

        for (int i = 0; i < this.crafters.size(); ++i) {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastCookTime != this.furnaceIn.furnaceCookTime) {
                icrafting.sendProgressBarUpdate(this, 0, this.furnaceIn.furnaceCookTime);
            }

            if (this.lastBurnTime != this.furnaceIn.tableBurnTime) {
                icrafting.sendProgressBarUpdate(this, 1, this.furnaceIn.tableBurnTime);
            }

            if (this.lastItemBurnTime != this.furnaceIn.currentItemBurnTime) {
                icrafting.sendProgressBarUpdate(this, 2, this.furnaceIn.currentItemBurnTime);
            }

            if (this.lastWater != this.furnaceIn.water) {
                icrafting.sendProgressBarUpdate(this, 3, this.furnaceIn.water);
            }
        }

        this.lastCookTime = this.furnaceIn.furnaceCookTime;
        this.lastBurnTime = this.furnaceIn.tableBurnTime;
        this.lastItemBurnTime = this.furnaceIn.currentItemBurnTime;
        this.lastWater = this.furnaceIn.water;
    }


    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        return null;
    }
} public class GuiBeverageMaking extends GuiContainer {

    private TileEntityBeverageMaking tile;

    public GuiBeverageMaking(InventoryPlayer playerInv, TileEntityBeverageMaking tileEntityTpj) {
        super(new ContainerBeverageMaking(playerInv, tileEntityTpj));
        this.tile = tileEntityTpj;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/tpj.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if (this.tile.isBurning()) {
            i1 = this.tile.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 145, (int)(l + 35 - i1), 176, (int)(12 - i1), 14, (int)(i1 + 2));;
        } else {
            if(this.tile.iscold()) {
                i1 = this.tile.getcoldRemainingScaled(11);
                this.drawTexturedModalRect(k + 146, (int)(l + 65 - i1), 190, (int)(11 - i1), 13, (int)(i1 + 2));;
            }

        }

        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 58, l + 30, 176, 14, (int)(i1 + 1), 16);
        if(this.tile.water > 0) {
            int i2 = this.tile.getWater();
            this.drawTexturedModalRect(k + 18, l + 14 + 58 - i2, 176, 31 + 58 - i2, 11,(int) (58 * ((float)i2 / 58)));
        } else {
            if(this.tile.milk > 0) {
                int i3 = this.tile.getMilk();
                this.drawTexturedModalRect(k + 18, l + 14 + 58 - i3, 187, 31 + 58 - i3, 11,(int) (58 * ((float)i3 / 58)));
            }
        }
    }

    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleTpj");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
} public class GuiBrewBarrel extends GuiContainer {

    private TileEntityBrewBarrel tile;

    public GuiBrewBarrel(InventoryPlayer playerInv, TileEntityBrewBarrel tileEntityNt) {
        super(new ContainerBrewBarrel(playerInv, tileEntityNt));
        this.tile = tileEntityNt;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/nt.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);

        float i1;

        int i2 = this.tile.getWater();
        this.drawTexturedModalRect(k + 18, l + 14 + 58 - i2, 176, 31 + 58 - i2, 11,(int) (58 * ((float)i2 / 58)));
        if (this.tile.isBurning()) {
            String time = StatCollector.translateToLocal("Nt.Time");
            String second = StatCollector.translateToLocal("Nt.Second");
            this.fontRendererObj.drawString(time + ": " + ((3600 - this.tile.furnaceCookTime)/20 + " " + second), k + 53, l + 53, 4210752);
        }
    }


    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleNt");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
} public class GuiChoppingBoard extends GuiContainer {

    private TileEntityChoppingBoard tile;

    public GuiChoppingBoard(InventoryPlayer playerInv, TileEntityChoppingBoard tileEntityCaiban) {
        super(new ContainerChoppingBoard(playerInv, tileEntityCaiban));
        this.tile = tileEntityCaiban;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/caiban.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    }

    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleCaiban");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
        this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
    }
} public class GuiFrying extends GuiContainer {

    private TileEntityFrying tile;

    public GuiFrying(InventoryPlayer playerInv, TileEntityFrying tileEntityYZJ) {
        super(new ContainerFrying(playerInv, tileEntityYZJ));
        this.tile = tileEntityYZJ;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/yzj.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if (this.tile.isBurning()) {
            i1 = this.tile.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 122, (int)(l + 74 - i1), 176, (int)(12 - i1), 14, (int)(i1 + 2));;
        }
        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 92, l + 30, 176, 14, (int)(i1 + 1), 16);
        int i2 = this.tile.getWater();
        this.drawTexturedModalRect(k + 18, l + 14 + 58 - i2, 176, 31 + 58 - i2, 11,(int) (58 * ((float)i2 / 58)));
    }

    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleYZJ");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
} public class GuiMill extends GuiContainer {

    private TileEntityMill tile;

    public GuiMill(InventoryPlayer playerInv, TileEntityMill furnaceInv) {
        super(new ContainerMill(playerInv, furnaceInv));
        this.tile = furnaceInv;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/repairtable.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        int a = tile.tableBurnTime;
        int b = tile.currentItemBurnTime;
        float i1;
        if (this.tile.isBurning()) {
            i1 = this.tile.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 81, (int)(l + 49 - i1), 176, (int)(12 - i1), 14, (int)(i1 + 2));
        }
        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 76, l + 19, 176, 14, (int)(i1 + 1), 16);
    }


    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleNmj");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
        this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
    }
} public class GuiPan extends GuiContainer {

    private TileEntityPan tile;

    public GuiPan(InventoryPlayer playerInv, TileEntityPan furnaceInv) {
        super(new ContainerPan(playerInv, furnaceInv));
        this.tile = furnaceInv;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/pdg.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if(tile.furnaceCookTime > 0) {
            if(tile.min > 0 && tile.max > 0) {
                this.drawTexturedModalRect(k + 46, l + 62, 176, 31, (int)((float)tile.Nowheat * 77F /1000F), 3);
                this.drawTexturedModalRect(k + 45 + (int)((float)(((float)tile.min)/ 1000F) * 77), l + 61, 176, 34, 1, 5);
                this.drawTexturedModalRect(k + 45 + (int)((float)(((float)tile.max)/ 1000F) * 77), l + 61, 177, 34, 1, 5);
            }
        }
        if (this.tile.isfire()) {
            i1 = this.tile.getBurnTimeRemainingScaled(14);
            this.drawTexturedModalRect(k + 81,(int)(l + 33 - i1), 176,(int)(15 - i1), 14, (int)(i1));
        }
        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 72, l + 39, 176, 14, (int)(i1), 16);

        if(mouseX >= k + 81 && mouseX <= k + 81 + 14 && mouseY >= l + 19 && mouseY <= l + 19 + 14) {
            String s = null;
            if(this.tile.currentItemBurnTime <= 20) {
                s = StatCollector.translateToLocal("gui.lowfire.name");
            } else {
                if(this.tile.currentItemBurnTime <= 40 && this.tile.currentItemBurnTime > 20) {
                    s = StatCollector.translateToLocal("gui.mlowfire.name");
                } else {
                    if(this.tile.currentItemBurnTime <= 60 && this.tile.currentItemBurnTime > 40) {
                        s = StatCollector.translateToLocal("gui.medfire.name");
                    } else {
                        if(this.tile.currentItemBurnTime <= 80 && this.tile.currentItemBurnTime > 60) {
                            s = StatCollector.translateToLocal("gui.mhighfire.name");
                        } else {
                            if(this.tile.currentItemBurnTime <= 100 && this.tile.currentItemBurnTime > 80) {
                                s = StatCollector.translateToLocal("gui.highfire.name");
                            }
                        }
                    }
                }
            }
            this.drawCreativeTabHoveringText(this.tile.currentItemBurnTime + "%, " + s, mouseX, mouseY);
        }

        this.fontRendererObj.drawString(StatCollector.translateToLocal("gui.UseF.name") +
                                        this.tile.frequencyOfUse, k + 7, l + 68, 4210752);
    }


    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitlePDG");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
    @Override
    protected void mouseClicked(int mouseX, int mouseY, int type) {
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        try {
            super.mouseClicked(mouseX, mouseY, type);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if(type == 0) {
            if (this.tile.isfire()) {
                if(mouseX >= k + 81 && mouseX <= k + 81 + 14 && mouseY >= l + 19 && mouseY < l + 32) {
                    int i1 = mouseY - (l + 18);
                    float f1 = ((float)i1)/14;
                    NBTTagCompound nbt = new NBTTagCompound();
                    nbt.setInteger("x", tile.getPos().getX());
                    nbt.setInteger("y", tile.getPos().getY());
                    nbt.setInteger("z", tile.getPos().getZ());
                    nbt.setFloat("f1", f1);
                    PacketDispatcher.instance.sendToServer(new HeatMessage(nbt));
                }
            }
        }
    }
} public class GuiPerssureCooker extends GuiContainer {

    private TileEntityPressureCooker tile;

    public GuiPerssureCooker(InventoryPlayer playerInv, TileEntityPressureCooker tileEntityGyg) {
        super(new ContainerPressureCooker(playerInv, tileEntityGyg));
        this.tile = tileEntityGyg;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/gyg.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if (this.tile.isBurning()) {
            i1 = this.tile.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 122, (int)(l + 74 - i1), 176, (int)(12 - i1), 14, (int)(i1 + 2));;
        }
        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 118, l + 30, 176, 14, (int)(i1 + 1), 16);
        int i2 = this.tile.getWater();
        this.drawTexturedModalRect(k + 18, l + 14 + 58 - i2, 176, 31 + 58 - i2, 11,(int) (58 * ((float)i2 / 58)));
    }

    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleGyg");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
} public class GuiPot extends GuiContainer {

    private TileEntityPot tile;

    public GuiPot(InventoryPlayer playerInv, TileEntityPot tileEntityGuo) {
        super(new ContainerPot(playerInv, tileEntityGuo));
        this.tile = tileEntityGuo;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/guo.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if(tile.furnaceCookTime > 0) {
            if(tile.min > 0 && tile.max > 0) {
                this.drawTexturedModalRect(k + 48, l + 38, 176, 31, (int)((float)tile.Nowheat * 77F /1000F), 3);
                this.drawTexturedModalRect(k + 48 + (int)((float)(((float)tile.min)/ 1000F) * 77), l + 37, 176, 34, 1, 5);
                this.drawTexturedModalRect(k + 48 + (int)((float)(((float)tile.max)/ 1000F) * 77), l + 37, 177, 34, 1, 5);
            }
        }
        if (this.tile.isfire()) {
            i1 = this.tile.getBurnTimeRemainingScaled(14);
            this.drawTexturedModalRect(k + 81,(int)(l + 79 - i1), 176,(int)(15 - i1), 14, (int)(i1));
        }

        i1 = this.tile.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 93, l + 19, 176, 14, (int)(i1 + 1), 16);

        this.fontRendererObj.drawString(StatCollector.translateToLocal("gui.UseF.name") +
                                        this.tile.frequencyOfUse, k + 7, l + 68, 4210752);

        if(mouseX >= k + 81 && mouseX <= k + 81 + 14 && mouseY >= l + 65 && mouseY < l + 65 + 14) {
            String s = null;
            if(this.tile.currentItemBurnTime <= 20) {
                s = StatCollector.translateToLocal("gui.lowfire.name");
            } else {
                if(this.tile.currentItemBurnTime <= 40 && this.tile.currentItemBurnTime > 20) {
                    s = StatCollector.translateToLocal("gui.mlowfire.name");
                } else {
                    if(this.tile.currentItemBurnTime <= 60 && this.tile.currentItemBurnTime > 40) {
                        s = StatCollector.translateToLocal("gui.medfire.name");
                    } else {
                        if(this.tile.currentItemBurnTime <= 80 && this.tile.currentItemBurnTime > 60) {
                            s = StatCollector.translateToLocal("gui.mhighfire.name");
                        } else {
                            if(this.tile.currentItemBurnTime <= 100 && this.tile.currentItemBurnTime > 80) {
                                s = StatCollector.translateToLocal("gui.highfire.name");
                            }
                        }
                    }
                }
            }
            this.drawCreativeTabHoveringText(this.tile.currentItemBurnTime + "%, " + s, mouseX, mouseY);
        }
    }


    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleGuo");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
    protected void mouseClicked(int mouseX, int mouseY, int type) {
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        try {
            super.mouseClicked(mouseX, mouseY, type);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if(type == 0) {
            if (this.tile.isfire()) {
                if(mouseX >= k + 81 && mouseX <= k + 81 + 14 && mouseY >= l + 65 && mouseY < l + 78) {
                    int i1 = mouseY - (l + 64);
                    float f1 = ((float)i1)/14;
                    NBTTagCompound nbt = new NBTTagCompound();
                    nbt.setInteger("x", tile.getPos().getX());
                    nbt.setInteger("y", tile.getPos().getY());
                    nbt.setInteger("z", tile.getPos().getZ());
                    nbt.setFloat("f1", f1);
                    PacketDispatcher.instance.sendToServer(new HeatMessagePot(nbt));
                }
            }
        }
    }
} public class GuiStove extends GuiContainer {

    private TileEntityStove tile;

    public GuiStove(InventoryPlayer playerInv, TileEntityStove tileEntityZl) {
        super(new ContainerStove(playerInv, tileEntityZl));
        this.tile = tileEntityZl;
        this.doesGuiPauseGame();
    }

    @Override
    public void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(new ResourceLocation("foodcraft", "textures/gui/container/zl.png"));
        int k = (this.width - this.xSize) / 2;//x
        int l = (this.height - this.ySize) / 2;//y
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        float i1;
        if (this.tile.isBurning()) {
            i1 = this.tile.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 81, (int)(l + 48 - i1), 176, (int)(12 - i1), 14, (int)(i1 + 2));
        }
        if(this.tile.canSmelt()) {
            this.drawTexturedModalRect(k + 83, l + 22, 176, 14, 9, 9);
        }
    }

    @Override
    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        String s = StatCollector.translateToLocal("TitleZl");
        this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
    }
} public class TileEntityBeverageMaking extends TileEntityFoodcraft implements ITickable {


    public int tableBurnTime = 0;
    public int maxBurnTime = 0;
    public int currentItemBurnTime = 0;
    public int furnaceCookTime;
    public int water;
    public int coldBurnTime;
    public int currentItemcoldBurnTime;
    public int milk;
    private ItemStack cai;
    private ItemStack coldcai;
    private boolean iswater;
    private boolean iswater2;

    public TileEntityBeverageMaking() {
        this.stack = new ItemStack[5];
    }
    @Override
    public void update() {

        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;
        boolean flag1_ = false;

        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;
        }
        if (this.coldBurnTime > 0) {
            --this.coldBurnTime;
        }

        if (!this.worldObj.isRemote) {
            iswater = gettp();

            if (this.tableBurnTime == 0 && this.hotcanSmelt()) {
                this.currentItemBurnTime = this.tableBurnTime = getItemBurnTime(this.stack[3]);

                if (this.tableBurnTime > 0) {
                    flag1 = true;

                    if (this.stack[3] != null) {
                        --this.stack[3].stackSize;

                        if (this.stack[3].stackSize == 0) {
                            this.stack[3] = stack[3].getItem().getContainerItem(stack[3]);
                        }
                    }
                }
            }

            if (this.isBurning() && this.hotcanSmelt()) {
                ++this.furnaceCookTime;

                if (this.furnaceCookTime == 350) {
                    this.furnaceCookTime = 0;
                    this.hotsmeltItem();
                    flag1 = true;
                }
            }
            BlockBeverageMaking.setState(this.isBurning() || iscold(), this.worldObj, this.pos);

            iswater2 = gettp2();
            if (this.coldBurnTime == 0 && this.coldcanSmelt()) {
                this.currentItemcoldBurnTime = this.coldBurnTime = getcold();

                if (this.coldBurnTime > 0) {
                    flag1_ = true;

                    if (this.stack[4] != null) {
                        --this.stack[4].stackSize;

                        if (this.stack[4].stackSize == 0) {
                            this.stack[4] = stack[4].getItem().getContainerItem(stack[4]);
                        }
                    }
                }
            }

            if (this.iscold() && this.coldcanSmelt()) {
                ++this.furnaceCookTime;

                if (this.furnaceCookTime == 350) {
                    this.furnaceCookTime = 0;
                    this.coldsmeltItem();
                    flag1_ = true;
                }
            }

            if (flag1_) {
                this.markDirty();
            }
            if (stack[0] != null) {
                if(water != 8) {
                    if(milk == 0) {
                        if(stack[0].getItem() == Items.potionitem) {
                            stack[0] = new ItemStack(Items.glass_bottle);
                            ++water;
                        }
                    }
                    if(stack[0].getItem().equals(FoodcraftItems.Itemwater)) {
                        --stack[0].stackSize;
                        ++water;
                    }
                }

                if (stack[0] != null) {
                    if(milk != 8) {
                        if(water == 0) {
                            if(stack[0].getItem() == Items.milk_bucket) {
                                stack[0] = new ItemStack(Items.bucket);
                                ++milk;
                            }
                        }
                    }
                }
                if (stack[0] != null) {
                    if(stack[0].stackSize <= 0) {
                        stack[0] = null;
                    }
                }
            }
        }
    }

    private int getcold() {
        if(stack[4] != null) {
            if(stack[4].getItem() == Item.getItemFromBlock(Blocks.ice))return 2500;
        }
        return 0;
    }

    private boolean gettp2() {
        if(stack[1] !=null) {
            if(water >= 1) {
                ItemStack is1 = RecipeBeverageMaking.making().getOutput(stack[1], false, true);
                if(is1 != null) {
                    coldcai = is1;
                    return true;
                }
            }

            if(milk >= 1) {
                ItemStack is1 = RecipeBeverageMaking.making().getOutput(stack[1], true, true);
                if(is1 != null) {
                    coldcai = is1;
                    return false;
                }
            }
            coldcai = null;
        }
        return false;
    }

    @Override
    public String getName() {
        return "BeverageMaking";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.currentItemcoldBurnTime = par1NBTTagCompound.getShort("currentItemcoldBurnTime");
        this.coldBurnTime = par1NBTTagCompound.getShort("coldBurnTime");
        this.water = par1NBTTagCompound.getShort("water");
        this.milk = par1NBTTagCompound.getShort("milk");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("currentItemcoldBurnTime", (short)this.currentItemcoldBurnTime);
        par1NBTTagCompound.setShort("coldBurnTime", (short)this.coldBurnTime);
        par1NBTTagCompound.setShort("water", (short)this.water);
        par1NBTTagCompound.setShort("milk", (short)this.milk);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Items", var2);

    }

    private static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 150;
                }

                if (block.getMaterial() == Material.wood) {
                    return 300;
                }
                if (block == Blocks.coal_block) {
                    return 16000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
            if (item == Items.stick) return 100;
            if (item == Items.coal) return 1600;
            if (item == Items.lava_bucket) return 20000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
            if (item == Items.blaze_rod) return 2400;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }

    private boolean hotcanSmelt() {
        if (this.stack[1] == null) {
            return false;
        } else {
            if (cai == null) return false;
            if (iswater) {
                if(!(water >= 1))return false;
            } else {
                if(!(milk >= 1))return false;
            }
            if (this.stack[2] == null) return true;
            if (!this.stack[2].isItemEqual(cai)) return false;
            int result = stack[2].stackSize + cai.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
        }
    }

    private boolean coldcanSmelt() {
        if (this.stack[1] == null) {
            return false;
        } else {
            if (coldcai == null) return false;
            if (iswater2) {
                if(!(water >= 1))return false;
            } else {
                if(!(milk >= 1))return false;
            }
            if (this.stack[2] == null) return true;
            if (!this.stack[2].isItemEqual(coldcai)) return false;
            int result = stack[2].stackSize + coldcai.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
        }
    }
    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    private void hotsmeltItem() {
        if (this.hotcanSmelt()) {

            if(water >= 1) {
                --water;
            } else {
                if(milk >= 1) {
                    --milk;
                } else {
                    return;
                }
            }

            if (this.stack[2] == null) {
                this.stack[2] = cai.copy();
            } else if (this.stack[2].getItem() == cai.getItem()) {
                this.stack[2].stackSize += cai.stackSize;
            }
            --this.stack[1].stackSize;

            if (this.stack[1].stackSize <= 0) {
                this.stack[1] = null;
            }
        }
    }

    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        if (this.currentItemBurnTime == 0) {
            this.currentItemBurnTime = 200;
        }
        return this.tableBurnTime * int1 / this.currentItemBurnTime;
    }

    @SideOnly(Side.CLIENT)
    public float getcoldRemainingScaled(int int1) {
        if (this.currentItemcoldBurnTime == 0) {
            this.currentItemcoldBurnTime = 200;
        }
        return this.coldBurnTime * int1 / this.currentItemcoldBurnTime;
    }

    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 350;
    }

    public int getWater() {
        return this.water * 7;
    }

    public int getMilk() {
        return this.milk * 7;
    }


    public boolean iscold() {
        return this.coldBurnTime > 0;
    }

    private boolean gettp() {
        if(stack[1] !=null) {

            if(water >= 1) {
                ItemStack is1 = RecipeBeverageMaking.making().getOutput(stack[1], false, false);
                if(is1 != null) {
                    cai = is1;
                    return true;
                }
            }

            if(milk >= 1) {
                ItemStack is1 = RecipeBeverageMaking.making().getOutput(stack[1], true, false);
                if(is1 != null) {
                    cai = is1;
                    return false;
                }
            }
            cai = null;
        }
        return false;
    }

    private void coldsmeltItem() {
        if (this.coldcanSmelt()) {
            if(water >= 1) {
                --water;
            } else {
                if(milk >= 1) {
                    --milk;
                } else {
                    return;
                }
            }

            if (this.stack[2] == null) {
                this.stack[2] = coldcai.copy();
            } else if (this.stack[2].getItem() == coldcai.getItem()) {
                this.stack[2].stackSize += coldcai.stackSize;
            }
            --this.stack[1].stackSize;

            if (this.stack[1].stackSize <= 0) {
                this.stack[1] = null;
            }
        }
    }
} public class TileEntityBrewBarrel extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int maxBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;
    public int water;
    private ItemStack cai;

    public TileEntityBrewBarrel() {
        this.stack = new ItemStack[6];
    }

    @Override
    public void update() {

        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;


        if (!this.worldObj.isRemote) {
            cai();


            if (cai != null && this.water == 8 && canSmelt()) {
                ++this.furnaceCookTime;

                if (this.furnaceCookTime == 3600) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                    flag1 = true;
                }
            } else {
                this.furnaceCookTime = 0;
            }

            if (flag1) {
                this.markDirty();
            }
            if (stack[3] != null) {
                if(water != 8) {

                    if(stack[3].getItem().equals(Items.potionitem)) {

                        stack[3] = new ItemStack(Items.glass_bottle);
                        ++water;

                    }
                    if(stack[3].getItem().equals(FoodcraftItems.Itemwater)) {

                        --stack[3].stackSize;
                        ++water;

                    }
                    if(stack[3].stackSize <= 0) {

                        stack[3] = null;

                    }
                }
            }
        }
    }

    @Override
    public String getName() {
        return "BrewBarrel";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.water = par1NBTTagCompound.getShort("water");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("water", (short)this.water);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Items", var2);

    }

    private static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 150;
                }

                if (block.getMaterial() == Material.wood) {
                    return 300;
                }
                if (block == Blocks.coal_block) {
                    return 16000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
            if (item == Items.stick) return 100;
            if (item == Items.coal) return 1600;
            if (item == Items.lava_bucket) return 20000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
            if (item == Items.blaze_rod) return 2400;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }

    private boolean canSmelt() {
        if(this.stack[5] != null) {
            if (!this.stack[5].isItemEqual(cai)) return false;
            int result = stack[5].stackSize + cai.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[5].getMaxStackSize();
        }

        if (this.stack[0] != null && this.stack[1] != null && this.stack[2] != null) {
            if (cai == null) return false;
            return true;
        }
        return false;
    }

    private void smeltItem() {
        if (this.stack[5] == null) {
            this.stack[5] = cai.copy();
        } else if (this.stack[5].getItem() == cai.getItem()) {
            this.stack[5].stackSize += cai.stackSize;
        }

        --this.stack[0].stackSize;
        --this.stack[1].stackSize;
        --this.stack[2].stackSize;

        if (this.stack[0].stackSize <= 0) {
            this.stack[0] = null;
        }
        if (this.stack[1].stackSize <= 0) {
            this.stack[1] = null;
        }
        if (this.stack[2].stackSize <= 0) {
            this.stack[2] = null;
        }
        water =  0;
    }

    public int getWater() {
        return this.water * 7;
    }
    private void cai() {
        if(stack[0] != null && stack[1] != null && stack[2] != null) {
            cai = RecipeBrewBarrel.brewing().getOutput(stack[0].getItem(), stack[1].getItem(), stack[2].getItem());
        } else {
            cai = null;
        }
    }

    public boolean isBurning() {
        return this.furnaceCookTime > 0;
    }

} public class TileEntityChoppingBoard extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;
    private ItemStack cai;
    private int q = 0;

    public TileEntityChoppingBoard() {
        this.stack = new ItemStack[5];
    }

    @Override
    public void update() {

        if (!this.worldObj.isRemote) {
            cai = this.canchao();
            if (stack[0] != null) {
                if (stack[0].getItem() == FoodcraftItems.ItemCaidao) {
                    if(cai != null) {
                        if(isst()) {
                            q = 0;
                            s();
                            if(stack[0].getItemDamage() < 59) {
                                stack[0].setItemDamage(stack[0].getItemDamage() + 1);
                            }

                            else {
                                stack[0] = null;
                            }
                        }
                    }
                }
                if(stack[0].getItem() instanceof IItemKitchenKnife) {
                    if(cai != null) {
                        if(isst()) {
                            IItemKitchenKnife iikk = (IItemKitchenKnife)stack[0].getItem();

                            q = iikk.event(worldObj, getPos(), cai, cai.stackSize);
                            s();
                            if(stack[0].getItemDamage() < iikk.getMaxUses()) {
                                stack[0].setItemDamage(stack[0].getItemDamage() + 1);
                            }

                            else {
                                stack[0] = null;
                            }
                        }
                    }
                }
            }
        }
    }

    private boolean isst() {
        if(stack[4] != null) {
            int result = stack[4].stackSize + cai.stackSize;
            boolean e =  result <= getInventoryStackLimit() && result <= this.stack[4].getMaxStackSize();
            return e;
        }
        return true;
    }

    private void s() {
        if (this.stack[4] == null) {
            this.stack[4] = cai.copy();
            if(this.stack[4].stackSize + q <= 64) {
                this.stack[4].stackSize += q;
            }
        } else if (this.stack[4].getItem() == cai.getItem()) {
            this.stack[4].stackSize += cai.stackSize;
            if(this.stack[4].stackSize + q <= 64) {
                this.stack[4].stackSize += q;
            }
        }
        if(this.stack[1] != null) {
            --stack[1].stackSize;
        }
        if(this.stack[2] != null) {
            --stack[2].stackSize;
        }
        if(this.stack[3] != null) {
            --stack[3].stackSize;
        }
        if(stack[1] != null) {
            if (this.stack[1].stackSize <= 0) {
                this.stack[1] = null;
            }
        }
        if(stack[2] != null) {
            if (this.stack[2].stackSize <= 0) {
                this.stack[2] = null;
            }
        }
        if(stack[3] != null) {
            if (this.stack[3].stackSize <= 0) {
                this.stack[3] = null;
            }
        }
    }



    private ItemStack canchao() {
        if(stack[1] != null && stack[2] == null && stack[3] == null) { //1 not null
            return RecipeChoppingBoard.chopping().getOutput(stack[1].getItem(),null,null);
        }
        if(stack[1] != null && stack[2] != null && stack[3] == null) { //1,2 not null
            return RecipeChoppingBoard.chopping().getOutput(stack[1].getItem(),stack[2].getItem(),null);
        }
        if(stack[1] != null && stack[2] == null && stack[3] != null) { //1,3 not null
            return RecipeChoppingBoard.chopping().getOutput(stack[1].getItem(),null,stack[3].getItem());
        }
        if(stack[1] == null && stack[2] != null && stack[3] == null) { //2 not null
            return RecipeChoppingBoard.chopping().getOutput(null,stack[2].getItem(),null);
        }
        if(stack[1] == null && stack[2] != null && stack[3] != null) { //2,3 not null
            return RecipeChoppingBoard.chopping().getOutput(null,stack[2].getItem(),stack[3].getItem());
        }
        if(stack[1] == null && stack[2] != null && stack[3] != null) { //3 not null
            return RecipeChoppingBoard.chopping().getOutput(null,null,stack[3].getItem());
        }
        return null;
    }

    @Override
    public ItemStack decrStackSize(int par1, int par2) {
        if (this.stack[par1] != null) {
            ItemStack var3;
            if (this.stack[par1].stackSize <= par2) {
                var3 = this.stack[par1];
                this.stack[par1] = null;
                return var3;
            } else {
                var3 = this.stack[par1].splitStack(par2);
                if (this.stack[par1].stackSize == 0) {
                    this.stack[par1] = null;
                }
                return var3;
            }
        } else {
            return null;
        }
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("ItemsCaiban", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("ItemsCaiban", var2);
    }

    @Override
    public String getName() {
        return "ChoppingBoard";
    }
} public class TileEntityFrying extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int maxBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;
    public int water;

    public TileEntityFrying() {
        this.stack = new ItemStack[4];
    }

    @Override
    public void update() {

        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;
        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;
        }

        if (!this.worldObj.isRemote) {
            if (this.tableBurnTime == 0 && this.canSmelt() && this.water >= 2) {
                this.currentItemBurnTime = this.tableBurnTime = getItemBurnTime(this.stack[1]);

                if (this.tableBurnTime > 0) {
                    flag1 = true;

                    if (this.stack[1] != null) {
                        --this.stack[1].stackSize;

                        if (this.stack[1].stackSize == 0) {
                            this.stack[1] = stack[1].getItem().getContainerItem(stack[1]);
                        }
                    }
                }
            }

            if (this.isBurning() && this.canSmelt() && this.water >= 2) {
                ++this.furnaceCookTime;

                if (this.furnaceCookTime == 400) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                    flag1 = true;
                }
            } else {
                this.furnaceCookTime = 0;
            }
            if (flag != this.tableBurnTime > 0) {
                flag1 = true;
                BlockFrying.setState(this.isBurning(), this.worldObj, this.pos);
            }
        }

        if (flag1) {
            this.markDirty();
        }
        if (stack[2] != null) {
            if(water != 8) {


                if(stack[2].getItem() == FoodcraftItems.ItemHuashenyou) {

                    --stack[2].stackSize;
                    ++water;
                }
            }
            if(stack[2].stackSize == 0) {
                stack[2] = null;
            }
        }
    }


    @Override
    public String getName() {
        return "Frying";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.water = par1NBTTagCompound.getShort("water");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("water", (short)this.water);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Items", var2);

    }

    private static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 150;
                }

                if (block.getMaterial() == Material.wood) {
                    return 300;
                }
                if (block == Blocks.coal_block) {
                    return 16000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
            if (item == Items.stick) return 100;
            if (item == Items.coal) return 1600;
            if (item == Items.lava_bucket) return 20000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
            if (item == Items.blaze_rod) return 2400;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }

    private boolean canSmelt() {
        if (this.stack[0] == null) {
            return false;
        } else {
            ItemStack itemstack = RecipeFrying.frying().getSmeltingResult(this.stack[0]);
            if (itemstack == null) return false;
            if (this.stack[3] == null) return true;
            if (!this.stack[3].isItemEqual(itemstack)) return false;
            int result = stack[3].stackSize + itemstack.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[3].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
        }
    }
    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    private void smeltItem() {
        if (this.canSmelt()) {
            ItemStack itemstack = RecipeFrying.frying().getSmeltingResult(this.stack[0]);

            if (this.stack[3] == null) {
                this.stack[3] = itemstack.copy();
            } else if (this.stack[3].getItem() == itemstack.getItem()) {
                this.stack[3].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items
            }

            --this.stack[0].stackSize;
            --water;
            --water;
            if (this.stack[0].stackSize <= 0) {
                this.stack[0] = null;
            }
        }
    }
    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        if (this.currentItemBurnTime == 0) {
            this.currentItemBurnTime = 200;
        }

        return this.tableBurnTime * int1 / this.currentItemBurnTime;
    }

    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 400;
    }

    public int getWater() {
        return this.water * 7;
    }
} public class TileEntityMill extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int maxBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;

    public TileEntityMill() {
        this.stack = new ItemStack[3];
    }

    @Override
    public void update() {
        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;
        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;
        }

        if (!this.worldObj.isRemote) {
            if (this.tableBurnTime == 0 && this.canSmelt()) {
                this.currentItemBurnTime = this.tableBurnTime = getItemBurnTime(this.stack[2]);

                if (this.tableBurnTime > 0) {
                    flag1 = true;

                    if (this.stack[2] != null) {
                        --this.stack[2].stackSize;

                        if (this.stack[2].stackSize == 0) {
                            this.stack[2] = stack[2].getItem().getContainerItem(stack[2]);
                        }
                    }
                }
            }

            if (this.isBurning() && this.canSmelt()) {
                ++this.furnaceCookTime;

                if (this.furnaceCookTime == 200) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                    flag1 = true;
                }
            } else {
                this.furnaceCookTime = 0;
            }

            BlockMill.setState(this.isBurning(), this.worldObj, this.pos);

        }

        if (flag1) {
            this.markDirty();
        }
    }

    @Override
    public String getName() {
        return "Mill";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Items", var2);

    }

    public static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 150;
                }

                if (block.getMaterial() == Material.wood) {
                    return 300;
                }
                if (block == Blocks.coal_block) {
                    return 16000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
            if (item == Items.stick) return 100;
            if (item == Items.coal) return 1600;
            if (item == Items.lava_bucket) return 20000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 100;
            if (item == Items.blaze_rod) return 2400;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }

    private boolean canSmelt() {
        if (this.stack[0] == null) {
            return false;
        } else {
            ItemStack itemstack = RecipeMill.smelting().getSmeltingResult(this.stack[0]);
            if (itemstack == null) return false;
            if (this.stack[1] == null) return true;
            if (!this.stack[1].isItemEqual(itemstack)) return false;
            int result = stack[1].stackSize + itemstack.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[1].getMaxStackSize();
        }
    }
    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    private void smeltItem() {
        if (this.canSmelt()) {
            ItemStack itemstack = RecipeMill.smelting().getSmeltingResult(this.stack[0]);

            if (this.stack[1] == null) {
                this.stack[1] = itemstack.copy();
            } else if (this.stack[1].getItem() == itemstack.getItem()) {
                this.stack[1].stackSize += itemstack.stackSize;
            }

            --this.stack[0].stackSize;

            if (this.stack[0].stackSize <= 0) {
                this.stack[0] = null;
            }
        }
    }
    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        if (this.currentItemBurnTime == 0) {
            this.currentItemBurnTime = 200;
        }

        return this.tableBurnTime * int1 / this.currentItemBurnTime;
    }

    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 200;
    }
} public class TileEntityPan extends TileEntityFoodcraft implements ITickable {

    public int Nowheat = 0;
    public int tableBurnTime = 1;//max
    public int currentItemBurnTime = 50;
    public int furnaceCookTime;
    public int frequencyOfUse;
    private boolean isfire;
    public int max;
    public int min;
    private int w;

    public TileEntityPan() {
        this.stack = new ItemStack[4];
    }

    @Override
    public void update() {
        if(worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() != FoodcraftGuiBlocks.lit_Zl) {
            isfire = false;
        }
        if(worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() == FoodcraftGuiBlocks.lit_Zl) {
            isfire = true;
        }


        if (!this.worldObj.isRemote) {
            AxisAlignedBB aabb = AxisAlignedBB.fromBounds(this.getPos().getX() - 20, this.getPos().getY() - 20, this.getPos().getZ() -20, this.getPos().getX() + 20, this.getPos().getY() + 20, this.getPos().getZ() + 20);
            List<EntityLivingBase> l1 = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, aabb);
            for(EntityLivingBase elb : l1) {
                if(isfire) {
                    if(!(elb == null)) {
                        if((int)(elb.posX)-1 == this.getPos().getX()  && (int)(elb.posZ) == this.getPos().getZ()  && (int)(elb.posY) == this.getPos().getY() ) {
                            if(elb instanceof EntityPlayer) {
                                if(((EntityPlayer)elb).capabilities.isCreativeMode) {
                                    continue;
                                }
                            }
                            if(!elb.isBurning()) {
                                elb.setFire(3);
                            }
                        }
                    }
                } else {
                    if(currentItemBurnTime < 0) {
                        currentItemBurnTime = 0;
                    }
                }

            }
            if (isfire && this.canSmelt()) {
                this.furnaceCookTime = this.furnaceCookTime + 1;
                if(w == 16) {
                    Nowheat += (float)((float)currentItemBurnTime/2F);
                    w = 0;
                }
                w++;
                if(Nowheat > max) {
                    --this.stack[0].stackSize;
                    this.stack[2] = new ItemStack(FoodcraftItems.ItemShaojiaodeshiwu);
                    this.furnaceCookTime = 0;
                    Nowheat = 0;
                    if(stack[0].stackSize <= 0) {
                        stack[0]=null;
                    }
                }

                if (this.furnaceCookTime == 400) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                }
            } else {
                this.furnaceCookTime = 0;
                Nowheat = 0;
            }
        }
    }

    @Override
    public String getName() {
        return "ChoppingBoard";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("ItemsPDG", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.currentItemBurnTime = par1NBTTagCompound.getShort("currentItemBurnTime");
        this.frequencyOfUse = par1NBTTagCompound.getShort("frequencyOfUse");
        this.Nowheat = par1NBTTagCompound.getShort("Nowheat");
    }


    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("currentItemBurnTime", (short)this.currentItemBurnTime);
        par1NBTTagCompound.setShort("frequencyOfUse", (short)this.frequencyOfUse);
        par1NBTTagCompound.setShort("Nowheat", (short)this.Nowheat);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("ItemsPDG", var2);

    }

    private boolean canSmelt() {
        if (this.stack[0] == null) {
            return false;
        } else {
            CookingOutput pdgc = RecipePan.smelting().getSmeltingResult(this.stack[0]);
            if(pdgc == null) {
                return false;
            }
            ItemStack itemstack = pdgc.getItemStack();
            this.min = pdgc.getMin();
            this.max = pdgc.getMax();
            if (itemstack == null) return false;
            if (this.stack[1] == null) return true;
            if (!this.stack[1].isItemEqual(itemstack)) return false;
            int result = stack[1].stackSize + itemstack.stackSize;
            return result <= getInventoryStackLimit() && result <= this.stack[1].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
        }
    }
    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    private void smeltItem() {
        if (this.canSmelt()) {
            CookingOutput pdgc = RecipePan.smelting().getSmeltingResult(this.stack[0]);
            ItemStack itemstack = pdgc.getItemStack();
            if(Nowheat < min) {
                this.stack[2] = new ItemStack(stack[0].getItem());
                --this.stack[0].stackSize;
                if (this.stack[0].stackSize <= 0) {
                    this.stack[0] = null;
                }
                Nowheat = 0;
                return;
            }
            if (this.stack[1] == null) {
                this.stack[1] = itemstack.copy();
            } else if (this.stack[1].getItem() == itemstack.getItem()) {
                this.stack[1].stackSize += itemstack.stackSize;
            }

            --this.stack[0].stackSize;

            if (this.stack[0].stackSize <= 0) {
                this.stack[0] = null;
            }
            Nowheat = 0;
            if(frequencyOfUse < 3000) {
                frequencyOfUse += 1;
            }
        }
    }
    @SideOnly(Side.CLIENT)
    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 400;
    }

    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        return (((float)this.currentItemBurnTime)* int1) / 100F;
    }

    public boolean isfire() {
        return isfire;
    }
} public class TileEntityPot extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int currentItemBurnTime = 50;
    public int furnaceCookTime;
    public int frequencyOfUse;
    private boolean isfire;
    public ItemStack cai;
    public int max;
    public int min;
    private int w;
    public int Nowheat = 0;

    public TileEntityPot() {
        this.stack = new ItemStack[14];
    }

    @Override
    public void update() {
        if(worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() != FoodcraftGuiBlocks.lit_Zl) {
            isfire = false;
        }
        if(worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() == FoodcraftGuiBlocks.lit_Zl) {
            isfire = true;
        }

        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;
        }

        if (!this.worldObj.isRemote) {
            AxisAlignedBB aabb = AxisAlignedBB.fromBounds(this.getPos().getX() - 20, this.getPos().getY() - 20, this.getPos().getZ() -20, this.getPos().getX() + 20, this.getPos().getY() + 20, this.getPos().getZ() + 20);
            List<EntityLivingBase> l1 = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, aabb);
            for(EntityLivingBase elb : l1) {
                if(isfire) {
                    if(!(elb == null)) {
                        if((int)(elb.posX)-1 == this.getPos().getX()  && (int)(elb.posZ) == this.getPos().getZ()  && (int)(elb.posY) == this.getPos().getY() ) {
                            if(elb instanceof EntityPlayer) {
                                if(((EntityPlayer)elb).capabilities.isCreativeMode) {
                                    continue;
                                }
                            }
                            if(!elb.isBurning()) {
                                elb.setFire(3);
                            }
                        }
                    }
                }
            }
            cai = this.canchao();
            if (isfire && cai != null && isst()) {
                ++this.furnaceCookTime;
                if(w == 16) {
                    Nowheat += (float)((float)currentItemBurnTime/2F);
                    w = 0;
                }
                w++;

                if(Nowheat > max) {
                    if (stack[0] != null) {
                        --stack[0].stackSize;
                        if (stack[0].stackSize <= 0) {
                            stack[0] = null;
                        }
                    }
                    if (stack[1] != null) {
                        --stack[1].stackSize;
                        if (stack[1].stackSize <= 0) {
                            stack[1] = null;
                        }
                    }
                    if (stack[2] != null) {
                        --stack[2].stackSize;
                        if (stack[2].stackSize <= 0) {
                            stack[2] = null;
                        }
                    }
                    if (stack[3] != null) {
                        --stack[3].stackSize;
                        if (stack[3].stackSize <= 0) {
                            stack[3] = null;
                        }
                    }
                    if (stack[4] != null) {
                        --stack[4].stackSize;
                        if (stack[4].stackSize <= 0) {
                            stack[4] = null;
                        }
                    }
                    if (stack[5] != null) {
                        --stack[5].stackSize;
                        if (stack[5].stackSize <= 0) {
                            stack[5] = null;
                        }
                    }
                    if (stack[6] != null) {
                        --stack[6].stackSize;
                        if (stack[6].stackSize <= 0) {
                            stack[6] = null;
                        }
                    }
                    if (stack[7] != null) {
                        --stack[7].stackSize;
                        if (stack[7].stackSize <= 0) {
                            stack[7] = null;
                        }
                    }
                    if (stack[8] != null) {
                        --stack[8].stackSize;
                        if (stack[8].stackSize <= 0) {
                            stack[8] = null;
                        }
                    }
                    if (stack[9] != null) {
                        --stack[9].stackSize;
                        if (stack[9].stackSize <= 0) {
                            stack[9] = null;
                        }
                    }
                    if (stack[10] != null) {
                        --stack[10].stackSize;
                        if (stack[10].stackSize <= 0) {
                            stack[10] = null;
                        }
                    }
                    if (stack[11] != null) {
                        --stack[11].stackSize;
                        if (stack[11].stackSize <= 0) {
                            stack[11] = null;
                        }
                    }
                    this.stack[13] = new ItemStack(FoodcraftItems.ItemShaojiaodeshiwu);
                    this.furnaceCookTime = 0;
                    Nowheat = 0;
                }


                if (this.furnaceCookTime == 500) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                }
            } else {
                this.furnaceCookTime = 0;
                Nowheat = 0;
            }
        }
    }


    private boolean isst() {
        if(stack[12] != null) {
            int result = stack[12].stackSize + 1;
            boolean e =  result <= getInventoryStackLimit() && result <= this.stack[12].getMaxStackSize();
            return e;
        }
        return true;
    }

    @Override
    public String getName() {
        return "Pot";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("ItemsGuo", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.currentItemBurnTime = par1NBTTagCompound.getShort("currentItemBurnTime");
        this.frequencyOfUse = par1NBTTagCompound.getShort("frequencyOfUse");
        this.Nowheat = par1NBTTagCompound.getShort("Nowheat");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("currentItemBurnTime", (short)this.currentItemBurnTime);
        par1NBTTagCompound.setShort("frequencyOfUse", (short)this.frequencyOfUse);
        par1NBTTagCompound.setShort("Nowheat", (short)this.Nowheat);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("ItemsGuo", var2);
    }

    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    public void smeltItem() {
        if(Nowheat < min) {
            this.stack[13] = new ItemStack(stack[0].getItem());
            if (stack[0] != null) {
                --stack[0].stackSize;
                if (stack[0].stackSize <= 0) {
                    stack[0] = null;
                }
            }
            if (stack[1] != null) {
                --stack[1].stackSize;
                if (stack[1].stackSize <= 0) {
                    stack[1] = null;
                }
            }
            if (stack[2] != null) {
                --stack[2].stackSize;
                if (stack[2].stackSize <= 0) {
                    stack[2] = null;
                }
            }
            if (stack[3] != null) {
                --stack[3].stackSize;
                if (stack[3].stackSize <= 0) {
                    stack[3] = null;
                }
            }
            if (stack[4] != null) {
                --stack[4].stackSize;
                if (stack[4].stackSize <= 0) {
                    stack[4] = null;
                }
            }
            if (stack[5] != null) {
                --stack[5].stackSize;
                if (stack[5].stackSize <= 0) {
                    stack[5] = null;
                }
            }
            if (stack[6] != null) {
                --stack[6].stackSize;
                if (stack[6].stackSize <= 0) {
                    stack[6] = null;
                }
            }
            if (stack[7] != null) {
                --stack[7].stackSize;
                if (stack[7].stackSize <= 0) {
                    stack[7] = null;
                }
            }
            if (stack[8] != null) {
                --stack[8].stackSize;
                if (stack[8].stackSize <= 0) {
                    stack[8] = null;
                }
            }
            if (stack[9] != null) {
                --stack[9].stackSize;
                if (stack[9].stackSize <= 0) {
                    stack[9] = null;
                }
            }
            if (stack[10] != null) {
                --stack[10].stackSize;
                if (stack[10].stackSize <= 0) {
                    stack[10] = null;
                }
            }
            if (stack[11] != null) {
                --stack[11].stackSize;
                if (stack[11].stackSize <= 0) {
                    stack[11] = null;
                }
            }
            Nowheat = 0;
            return;
        }
        Nowheat = 0;
        if(frequencyOfUse < 3000) {
            frequencyOfUse += 1;
        }
        if (this.stack[12] == null) {
            this.stack[12] = cai.copy();
        } else if (this.stack[12].getItem() == cai.getItem()) {

            this.stack[12].stackSize += cai.stackSize;

        }
        if (stack[0] != null) {
            --stack[0].stackSize;
            if (stack[0].stackSize <= 0) {
                stack[0] = null;
            }
        }
        if (stack[1] != null) {
            --stack[1].stackSize;
            if (stack[1].stackSize <= 0) {
                stack[1] = null;
            }
        }
        if (stack[2] != null) {
            --stack[2].stackSize;
            if (stack[2].stackSize <= 0) {
                stack[2] = null;
            }
        }
        if (stack[3] != null) {
            --stack[3].stackSize;
            if (stack[3].stackSize <= 0) {
                stack[3] = null;
            }
        }
        if (stack[4] != null) {
            --stack[4].stackSize;
            if (stack[4].stackSize <= 0) {
                stack[4] = null;
            }
        }
        if (stack[5] != null) {
            --stack[5].stackSize;
            if (stack[5].stackSize <= 0) {
                stack[5] = null;
            }
        }
        if (stack[6] != null) {
            --stack[6].stackSize;
            if (stack[6].stackSize <= 0) {
                stack[6] = null;
            }
        }
        if (stack[7] != null) {
            --stack[7].stackSize;
            if (stack[7].stackSize <= 0) {
                stack[7] = null;
            }
        }
        if (stack[8] != null) {
            --stack[8].stackSize;
            if (stack[8].stackSize <= 0) {
                stack[8] = null;
            }
        }
        if (stack[9] != null) {
            --stack[9].stackSize;
            if (stack[9].stackSize <= 0) {
                stack[9] = null;
            }
        }
        if (stack[10] != null) {
            --stack[10].stackSize;
            if (stack[10].stackSize <= 0) {
                stack[10] = null;
            }
        }
        if (stack[11] != null) {
            --stack[11].stackSize;
            if (stack[11].stackSize <= 0) {
                stack[11] = null;
            }
        }

    }


    @SideOnly(Side.CLIENT)
    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 500;
    }

    private ItemStack canchao() {
        CookingOutput hj = RecipePot.smelting().getOutput(stack[0], stack[1], stack[2], stack[3],
                           stack[4], stack[5], stack[6], stack[7], stack[8], stack[9],
                           stack[10], stack[11]);
        if(hj != null) {
            if(hj.getItemStack() != null) {
                min = hj.getMin();
                max = hj.getMax();
                return hj.getItemStack();
            } else {
                return null;
            }
        } else {
            return null;
        }

    }

    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        return (((float)this.currentItemBurnTime)* int1) / 100F;
    }

    public boolean isfire() {
        return isfire;
    }
} public class TileEntityPressureCooker extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;
    public int water;
    private ItemStack cai;

    public TileEntityPressureCooker() {
        this.stack = new ItemStack[6];
    }

    @Override
    public void update() {

        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;
        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;
        }

        if (!this.worldObj.isRemote) {
            if (this.tableBurnTime == 0 && this.canSmelt()  && water >= 2) {
                this.currentItemBurnTime = this.tableBurnTime = getItemBurnTime(this.stack[4]);

                if (this.tableBurnTime > 0) {
                    flag1 = true;

                    if (this.stack[4] != null) {
                        --this.stack[4].stackSize;

                        if (this.stack[4].stackSize == 0) {
                            this.stack[4] = stack[4].getItem().getContainerItem(stack[4]);
                        }
                    }
                }
            }

            if (this.isBurning() && this.canSmelt() && water >= 2 && isst()) {
                ++this.furnaceCookTime;
                if (this.furnaceCookTime == 480) {
                    this.furnaceCookTime = 0;
                    this.smeltItem();
                    flag1 = true;
                }
            } else {
                this.furnaceCookTime = 0;
            }
            if (flag != this.tableBurnTime > 0) {
                flag1 = true;
            }
        }

        if (flag1) {
            this.markDirty();
        }

        if (stack[3] != null) {
            if(water != 8) {
                if(stack[3].getItem() == Items.water_bucket) {
                    ItemStack bucketitemstack = new ItemStack(Items.bucket);
                    stack[3] = bucketitemstack.copy();
                    ++water;
                }

                if(stack[3].getItem() == FoodcraftItems.Itemwater) {

                    --stack[3].stackSize;
                    ++water;
                }
            }
            if(stack[3].stackSize == 0) {
                stack[3] = null;
            }
        }

    }

    private boolean isst() {
        if(stack[5] != null) {
            int result = stack[5].stackSize + cai.stackSize;
            boolean e =  result <= getInventoryStackLimit() && result <= this.stack[5].getMaxStackSize();
            return e;
        }
        return true;
    }

    @Override
    public String getName() {
        return "PressureCooker";
    }


    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Gyg", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.water = par1NBTTagCompound.getShort("water");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("water", (short)this.water);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Gyg", var2);
    }

    private static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 100;
                }

                if (block.getMaterial() == Material.wood) {
                    return 200;
                }
                if (block == Blocks.coal_block) {
                    return 10000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 100;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 100;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 100;
            if (item == Items.stick) return 20;
            if (item == Items.coal) return 1000;
            if (item == Items.lava_bucket) return 10000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 20;
            if (item == Items.blaze_rod) return 1900;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }

    private boolean canSmelt() {
        if (this.stack[0] == null || this.stack[1] == null || this.stack[2] == null) {
            return false;
        } else {
            cai = RecipePressureCooker.cooking().getOutput(stack[0].getItem(),stack[1].getItem(),stack[2].getItem());

            if(cai != null) {
                if(stack[5] != null) {
                    if(stack[5].getItem() == cai.getItem()) {
                        return true;
                    } else {
                        return false;
                    }
                }
                return true;
            }

        }
        return false;
    }

    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }

    private void smeltItem() {
        if (this.canSmelt()) {
            ItemStack itemstack = cai;

            if (this.stack[5] == null) {
                this.stack[5] = itemstack.copy();
            } else if (this.stack[5].getItem() == itemstack.getItem()) {
                this.stack[5].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items
            }

            --this.stack[0].stackSize;
            --this.stack[1].stackSize;
            --this.stack[2].stackSize;
            water = water - 2;

            if (this.stack[0].stackSize <= 0) {
                this.stack[0] = null;
            }
            if (this.stack[1].stackSize <= 0) {
                this.stack[1] = null;
            }
            if (this.stack[2].stackSize <= 0) {
                this.stack[2] = null;
            }
        }
    }
    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        if (this.currentItemBurnTime == 0) {
            this.currentItemBurnTime = 200;
        }
        return this.tableBurnTime * int1 / this.currentItemBurnTime;
    }

    public float getCookProgressScaled(int int1) {
        return this.furnaceCookTime * int1 / 480;
    }

    public int getWater() {
        return this.water * 7;
    }
} public class TileEntityStove extends TileEntityFoodcraft implements ITickable {

    public int tableBurnTime = 0;
    public int maxBurnTime = 0;
    public int currentItemBurnTime;
    public int furnaceCookTime;
    public int water;

    public TileEntityStove() {
        this.stack = new ItemStack[4];
    }
    @Override
    public void update() {

        boolean flag = this.tableBurnTime > 0;
        boolean flag1 = false;

        if (this.tableBurnTime > 0) {
            --this.tableBurnTime;

        }

        if (!this.worldObj.isRemote) {

            if (this.tableBurnTime == 0 && this.canSmelt()) {
                this.currentItemBurnTime = this.tableBurnTime = getItemBurnTime(this.stack[0]);

                if (this.tableBurnTime > 0) {
                    flag1 = true;

                    if (this.stack[0] != null) {
                        --this.stack[0].stackSize;

                        if (this.stack[0].stackSize == 0) {
                            this.stack[0] = stack[0].getItem().getContainerItem(stack[0]);
                        }
                    }
                }
            }
            BlockStove.setState(this.isBurning(), this.worldObj, this.pos);
            if (flag1) {
                this.markDirty();
            }
        }

    }

    public boolean canSmelt() {
        if(this.worldObj.getBlockState(new BlockPos(getPos().getX(),getPos().getY()+1, getPos().getZ())).getBlock() == FoodcraftGuiBlocks.PDG ||
                this.worldObj.getBlockState(new BlockPos(getPos().getX(),getPos().getY()+1, getPos().getZ())).getBlock() == FoodcraftGuiBlocks.Guo)return true;
        return false;
    }

    @Override
    public String getName() {
        return "Stove";
    }

    public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
        super.readFromNBT(par1NBTTagCompound);
        NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
        this.stack = new ItemStack[this.getSizeInventory()];
        for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
            NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
            byte var5 = var4.getByte("Slot");
            if (var5 >= 0 && var5 < this.stack.length) {
                this.stack[var5] = ItemStack.loadItemStackFromNBT(var4);
            }
        }
        this.tableBurnTime = par1NBTTagCompound.getShort("tableBurnTime");
        this.furnaceCookTime = par1NBTTagCompound.getShort("furnaceCookTime");
        this.water = par1NBTTagCompound.getShort("water");
    }

    public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
        super.writeToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setShort("tableBurnTime", (short)this.tableBurnTime);
        par1NBTTagCompound.setShort("furnaceCookTime", (short)this.furnaceCookTime);
        par1NBTTagCompound.setShort("water", (short)this.water);
        NBTTagList var2 = new NBTTagList();
        for (int var3 = 0; var3 < this.stack.length; ++var3) {
            if (this.stack[var3] != null) {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte)var3);
                this.stack[var3].writeToNBT(var4);
                var2.appendTag(var4);
            }
        }
        par1NBTTagCompound.setTag("Items", var2);
    }

    public static int getItemBurnTime(ItemStack par0ItemStack) {
        if (par0ItemStack == null) {
            return 0;
        } else {
            net.minecraft.item.Item item = par0ItemStack.getItem();
            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);

                if (block == Blocks.wooden_slab) {
                    return 300;
                }

                if (block.getMaterial() == Material.wood) {
                    return 600;
                }
                if (block == Blocks.coal_block) {
                    return 32000;
                }
            }
            if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 400;
            if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 400;
            if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 400;
            if (item == Items.stick) return 200;
            if (item == Items.coal) return 3600;
            if (item == Items.lava_bucket) return 40000;
            if (item == Item.getItemFromBlock(Blocks.sapling)) return 200;
            if (item == Items.blaze_rod) return 4800;
            return GameRegistry.getFuelValue(par0ItemStack);
        }
    }


    public boolean isBurning() {
        return this.tableBurnTime > 0;
    }


    @SideOnly(Side.CLIENT)
    public float getBurnTimeRemainingScaled(int int1) {
        if (this.currentItemBurnTime == 0) {
            this.currentItemBurnTime = 200;
        }

        return this.tableBurnTime * int1 / this.currentItemBurnTime;
    }
}
import com.foodcraft.GuiIDs;
import com.foodcraft.gui.containers.ContainerBeverageMaking;
import com.foodcraft.gui.containers.ContainerBrewBarrel;
import com.foodcraft.gui.containers.ContainerChoppingBoard;
import com.foodcraft.gui.containers.ContainerFrying;
import com.foodcraft.gui.containers.ContainerMill;
import com.foodcraft.gui.containers.ContainerPan;
import com.foodcraft.gui.containers.ContainerPot;
import com.foodcraft.gui.containers.ContainerPressureCooker;
import com.foodcraft.gui.containers.ContainerStove;
import com.foodcraft.gui.guis.GuiBeverageMaking;
import com.foodcraft.gui.guis.GuiBrewBarrel;
import com.foodcraft.gui.guis.GuiChoppingBoard;
import com.foodcraft.gui.guis.GuiFrying;
import com.foodcraft.gui.guis.GuiMill;
import com.foodcraft.gui.guis.GuiPan;
import com.foodcraft.gui.guis.GuiPerssureCooker;
import com.foodcraft.gui.guis.GuiPot;
import com.foodcraft.gui.guis.GuiStove;
import com.foodcraft.gui.tileentities.TileEntityBeverageMaking;
import com.foodcraft.gui.tileentities.TileEntityBrewBarrel;
import com.foodcraft.gui.tileentities.TileEntityChoppingBoard;
import com.foodcraft.gui.tileentities.TileEntityFrying;
import com.foodcraft.gui.tileentities.TileEntityMill;
import com.foodcraft.gui.tileentities.TileEntityPan;
import com.foodcraft.gui.tileentities.TileEntityPot;
import com.foodcraft.gui.tileentities.TileEntityPressureCooker;
import com.foodcraft.gui.tileentities.TileEntityStove;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
package com.foodcraft.util;



public class FcGuiHandler implements IGuiHandler {

    @Override
    public Object getServerGuiElement(int id, EntityPlayer player, World world,
                                      int x, int y, int z) {
        BlockPos bp = new BlockPos(x,y,z);
        switch (id) {
        case GuiIDs.GUI_NMJ:
            return new ContainerMill(player.inventory, (TileEntityMill) world.getTileEntity(bp));
        case GuiIDs.GUI_PDG:
            return new ContainerPan(player.inventory, (TileEntityPan) world.getTileEntity(bp));
        case GuiIDs.GUI_Guo:
            return new ContainerPot(player.inventory, (TileEntityPot) world.getTileEntity(bp));
        case GuiIDs.GUI_Gyg:
            return new ContainerPressureCooker(player.inventory, (TileEntityPressureCooker) world.getTileEntity(bp));
        case GuiIDs.GUI_Caiban:
            return new ContainerChoppingBoard(player.inventory, (TileEntityChoppingBoard) world.getTileEntity(bp));
        case GuiIDs.GUI_YZJ:
            return new ContainerFrying(player.inventory, (TileEntityFrying) world.getTileEntity(bp));
        case GuiIDs.GUI_Nt:
            return new ContainerBrewBarrel(player.inventory, (TileEntityBrewBarrel) world.getTileEntity(bp));
        case GuiIDs.GUI_Zl:
            return new ContainerStove(player.inventory, (TileEntityStove) world.getTileEntity(bp));
        case GuiIDs.GUI_Tpj:
            return new ContainerBeverageMaking(player.inventory, (TileEntityBeverageMaking) world.getTileEntity(bp));
        default:
            return null;
        }
    }

    @Override
    public Object getClientGuiElement(int id, EntityPlayer player, World world,
                                      int x, int y, int z) {
        BlockPos bp = new BlockPos(x,y,z);
        switch (id) {
        case GuiIDs.GUI_NMJ:
            return new GuiMill(player.inventory, (TileEntityMill) world.getTileEntity(bp));
        case GuiIDs.GUI_PDG:
            return new GuiPan(player.inventory, (TileEntityPan) world.getTileEntity(bp));
        case GuiIDs.GUI_Guo:
            return new GuiPot(player.inventory, (TileEntityPot) world.getTileEntity(bp));
        case GuiIDs.GUI_Gyg:
            return new GuiPerssureCooker(player.inventory, (TileEntityPressureCooker) world.getTileEntity(bp));
        case GuiIDs.GUI_Caiban:
            return new GuiChoppingBoard(player.inventory, (TileEntityChoppingBoard) world.getTileEntity(bp));
        case GuiIDs.GUI_YZJ:
            return new GuiFrying(player.inventory, (TileEntityFrying) world.getTileEntity(bp));
        case GuiIDs.GUI_Nt:
            return new GuiBrewBarrel(player.inventory, (TileEntityBrewBarrel) world.getTileEntity(bp));