equivalent-exchange-3/src/main/java/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java
2014-01-05 22:22:59 -05:00

81 lines
2.7 KiB
Java

package com.pahimar.ee3.client.gui.inventory;
import com.pahimar.ee3.inventory.ContainerAlchemicalChest;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
/**
* Equivalent-Exchange-3
* <p/>
* GuiAlchemicalChest
*
* @author pahimar
*/
@SideOnly(Side.CLIENT)
public class GuiAlchemicalChest extends GuiContainer
{
private TileAlchemicalChest tileAlchemicalChest;
public GuiAlchemicalChest(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest)
{
super(new ContainerAlchemicalChest(inventoryPlayer, alchemicalChest));
tileAlchemicalChest = alchemicalChest;
if (this.tileAlchemicalChest.getState() == 0)
{
xSize = 230;
ySize = 186;
}
else if (this.tileAlchemicalChest.getState() == 1)
{
xSize = 230;
ySize = 240;
}
else if (this.tileAlchemicalChest.getState() == 2)
{
xSize = 248;
ySize = 256;
}
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y)
{
if (tileAlchemicalChest.getState() == 0 || tileAlchemicalChest.getState() == 1)
{
fontRenderer.drawString(tileAlchemicalChest.isInvNameLocalized() ? tileAlchemicalChest.getInvName() : StatCollector.translateToLocal(tileAlchemicalChest.getInvName()), 8, 6, 4210752);
// fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 35, ySize - 95 + 2, 4210752);
fontRenderer.drawString(tileAlchemicalChest.getOrientation().toString(), 35, ySize - 95 + 2, 4210752);
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if (tileAlchemicalChest.getState() == 0)
{
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_SMALL);
}
else if (tileAlchemicalChest.getState() == 1)
{
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_MEDIUM);
}
else if (tileAlchemicalChest.getState() == 2)
{
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_LARGE);
}
int xStart = (width - xSize) / 2;
int yStart = (height - ySize) / 2;
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
}
}