Mekanism-tilera-Edition/src/minecraft/net/uberkat/obsidian/client/GuiTheoreticalElementizer.java

56 lines
2.3 KiB
Java
Raw Normal View History

package net.uberkat.obsidian.client;
import org.lwjgl.opengl.GL11;
import net.minecraft.src.*;
import net.uberkat.obsidian.common.BlockTheoreticalElementizer;
import net.uberkat.obsidian.common.ContainerTheoreticalElementizer;
import net.uberkat.obsidian.common.TileEntityTheoreticalElementizer;
public class GuiTheoreticalElementizer extends GuiContainer
{
private TileEntityTheoreticalElementizer elementizerInventory;
public GuiTheoreticalElementizer(InventoryPlayer par1InventoryPlayer, TileEntityTheoreticalElementizer par2TileEntityTheoreticalElementizer)
{
super(new ContainerTheoreticalElementizer(par1InventoryPlayer, par2TileEntityTheoreticalElementizer));
elementizerInventory = par2TileEntityTheoreticalElementizer;
}
/**
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
*/
protected void drawGuiContainerForegroundLayer()
{
fontRenderer.drawString("Theoretical Elementizer", 45, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
}
public void onGuiClosed()
{
BlockTheoreticalElementizer.updateElementizerBlockState(elementizerInventory.elementizerBurnTime > 0, elementizerInventory.worldObj, elementizerInventory.xCoord, elementizerInventory.yCoord, elementizerInventory.zCoord);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture("/gui/GuiElementizer.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(var4);
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
int var7;
if (this.elementizerInventory.isBurning())
{
var7 = this.elementizerInventory.getBurnTimeRemainingScaled(12);
this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2);
}
var7 = this.elementizerInventory.getCookProgressScaled(24);
this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16);
}
}