2014-04-11 01:59:04 +02:00
|
|
|
package com.pahimar.ee3.client.gui.inventory;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.inventory.ContainerAlchemicalChest;
|
|
|
|
import com.pahimar.ee3.reference.Names;
|
|
|
|
import com.pahimar.ee3.reference.Textures;
|
2014-04-30 03:46:59 +02:00
|
|
|
import com.pahimar.ee3.tileentity.TileEntityAlchemicalChest;
|
2014-04-11 01:59:04 +02:00
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import net.minecraft.util.StatCollector;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
|
|
public class GuiAlchemicalChest extends GuiContainer
|
|
|
|
{
|
2014-04-30 03:46:59 +02:00
|
|
|
private TileEntityAlchemicalChest tileEntityAlchemicalChest;
|
2014-04-11 01:59:04 +02:00
|
|
|
|
2014-04-30 03:46:59 +02:00
|
|
|
public GuiAlchemicalChest(InventoryPlayer inventoryPlayer, TileEntityAlchemicalChest alchemicalChest)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
super(new ContainerAlchemicalChest(inventoryPlayer, alchemicalChest));
|
2014-04-30 03:46:59 +02:00
|
|
|
tileEntityAlchemicalChest = alchemicalChest;
|
2014-04-11 01:59:04 +02:00
|
|
|
|
2014-04-30 03:46:59 +02:00
|
|
|
if (this.tileEntityAlchemicalChest.getState() == 0)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
xSize = 230;
|
|
|
|
ySize = 186;
|
|
|
|
}
|
2014-04-30 03:46:59 +02:00
|
|
|
else if (this.tileEntityAlchemicalChest.getState() == 1)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
xSize = 230;
|
|
|
|
ySize = 240;
|
|
|
|
}
|
2014-04-30 03:46:59 +02:00
|
|
|
else if (this.tileEntityAlchemicalChest.getState() == 2)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
xSize = 248;
|
|
|
|
ySize = 256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void drawGuiContainerForegroundLayer(int x, int y)
|
|
|
|
{
|
2014-04-30 03:46:59 +02:00
|
|
|
if (tileEntityAlchemicalChest.getState() == 0 || tileEntityAlchemicalChest.getState() == 1)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
2014-04-30 03:46:59 +02:00
|
|
|
fontRendererObj.drawString(StatCollector.translateToLocal(tileEntityAlchemicalChest.getInventoryName()), 8, 6, 4210752);
|
2014-04-11 13:06:32 +02:00
|
|
|
fontRendererObj.drawString(StatCollector.translateToLocal(Names.Containers.VANILLA_INVENTORY), 35, ySize - 95 + 2, 4210752);
|
2014-04-11 01:59:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
|
|
|
|
{
|
|
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
|
2014-04-30 03:46:59 +02:00
|
|
|
if (tileEntityAlchemicalChest.getState() == 0)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_CHEST_SMALL);
|
|
|
|
}
|
2014-04-30 03:46:59 +02:00
|
|
|
else if (tileEntityAlchemicalChest.getState() == 1)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_CHEST_MEDIUM);
|
|
|
|
}
|
2014-04-30 03:46:59 +02:00
|
|
|
else if (tileEntityAlchemicalChest.getState() == 2)
|
2014-04-11 01:59:04 +02:00
|
|
|
{
|
|
|
|
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_CHEST_LARGE);
|
|
|
|
}
|
|
|
|
|
|
|
|
int xStart = (width - xSize) / 2;
|
|
|
|
int yStart = (height - ySize) / 2;
|
|
|
|
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
|
|
|
|
}
|
|
|
|
}
|