    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import org.lwjgl.opengl.GL11;
    006
    007    @SideOnly(Side.CLIENT)
    008    public class GuiBrewingStand extends GuiContainer
    009    {
    010        private TileEntityBrewingStand field_74217_o;
    011
    012        public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand)
    013        {
    014            super(new ContainerBrewingStand(par1InventoryPlayer, par2TileEntityBrewingStand));
    015            this.field_74217_o = par2TileEntityBrewingStand;
    016        }
    017
    018        /**
    019         * Draw the foreground layer for the GuiContainer (everything in front of the items)
    020         */
    021        protected void drawGuiContainerForegroundLayer(int par1, int par2)
    022        {
    023            this.fontRenderer.drawString(StatCollector.translateToLocal("container.brewing"), 56, 6, 4210752);
    024            this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
    025        }
    026
    027        /**
    028         * Draw the background layer for the GuiContainer (everything behind the items)
    029         */
    030        protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    031        {
    032            int var4 = this.mc.renderEngine.getTexture("/gui/alchemy.png");
    033            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    034            this.mc.renderEngine.bindTexture(var4);
    035            int var5 = (this.width - this.xSize) / 2;
    036            int var6 = (this.height - this.ySize) / 2;
    037            this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
    038            int var7 = this.field_74217_o.getBrewTime();
    039
    040            if (var7 > 0)
    041            {
    042                int var8 = (int)(28.0F * (1.0F - (float)var7 / 400.0F));
    043
    044                if (var8 > 0)
    045                {
    046                    this.drawTexturedModalRect(var5 + 97, var6 + 16, 176, 0, 9, var8);
    047                }
    048
    049                int var9 = var7 / 2 % 7;
    050
    051                switch (var9)
    052                {
    053                    case 0:
    054                        var8 = 29;
    055                        break;
    056                    case 1:
    057                        var8 = 24;
    058                        break;
    059                    case 2:
    060                        var8 = 20;
    061                        break;
    062                    case 3:
    063                        var8 = 16;
    064                        break;
    065                    case 4:
    066                        var8 = 11;
    067                        break;
    068                    case 5:
    069                        var8 = 6;
    070                        break;
    071                    case 6:
    072                        var8 = 0;
    073                }
    074
    075                if (var8 > 0)
    076                {
    077                    this.drawTexturedModalRect(var5 + 65, var6 + 14 + 29 - var8, 185, 29 - var8, 12, var8);
    078                }
    079            }
    080        }
    081    }