package com.Arteman.HellLand.gui;

import org.lwjgl.opengl.GL11;

import com.Arteman.HellLand.HellLand;
import com.Arteman.HellLand.container.ContainerCrystallOven;
import com.Arteman.HellLand.tileentity.TileEntityCrystallOven;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;

public class GuiCrystallOven extends GuiContainer
{
	public static final ResourceLocation bground = new ResourceLocation(HellLand.MODID + ":" + "textures/gui/GuiCrystallOven.png");
	
	public TileEntityCrystallOven crystallOven;
	
	public GuiCrystallOven(InventoryPlayer inventoryPlayer, TileEntityCrystallOven entity) 
	{
        super(new ContainerCrystallOven(inventoryPlayer, entity));

        this.crystallOven = entity;

        this.xSize = 176;
        this.ySize = 166;
    }
	
	public void drawGuiContainerForegroundLayer(int par1, int par2)
	{
        String name = "Crystall Oven";

        this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
        this.fontRendererObj.drawString(I18n.format("Container.inventory", new Object[0]), 118, this.ySize - 96 + 2, 4210752);
    }
	
	 @Override
	    protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)
	 {
	        GL11.glColor4f(1F, 1F, 1F, 1F);

	        Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
	        drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

	        if (this.crystallOven.isBurning())
	        {
	            int k = this.crystallOven.getBurnTimeRemainingScaled(40);
	            int j = 40 - k;
	            drawTexturedModalRect(guiLeft + 29, guiTop + 65, 176, 0, 40 - j, 10);
	        }

	        int k = this.crystallOven.getCookProgressScaled(24);
	        drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 10, k + 1, 16);
	 }
}

@@ -1594,24 +1594,25 @@
 e, ySize);%0A%0A
+%0A
 %09        if 
@@ -1720,18 +1720,18 @@
 gScaled(
+1
 4
-0
 );%0A%09    
@@ -1750,17 +1750,24 @@
 j = 
+1
 4
-0
  - k;%0A
-%09
+        
     
@@ -1810,10 +1810,10 @@
 t + 
-29
+43
 , gu
@@ -1825,28 +1825,117 @@
 + 65
+ + j
 , 176, 
-0, 40 - j, 10
+j, 14, k);%0A                    drawTexturedModalRect(guiLeft + 121, guiTop + 65 + j, 176, j, 14, k
 );%0A%09
@@ -2049,17 +2049,17 @@
 Left + 7
-9
+7
 , guiTop
@@ -2066,17 +2066,17 @@
  + 3
-4
+5
 , 176, 1
 0, k
@@ -2075,23 +2075,29 @@
 6, 1
-0
+4
 , k
- + 1
 , 16);%0A
+%09        %0A
 %09 %7D%0A

Fix GUI rendering for CrystallOven