blob: 4d90f4fcbab8410c5d456b56304ff2b9496c34f0 [file] [log] [blame] [raw]
package com.legacy.aether.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import com.legacy.aether.common.tile_entities.TileEntityTreasureChest;
@SideOnly(Side.CLIENT)
public class GuiTreasureChest extends GuiContainer
{
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png");
private final int inventoryRows;
public GuiTreasureChest(InventoryPlayer playerInventory, TileEntityTreasureChest chestInventory)
{
super(new ContainerChest(playerInventory, chestInventory, Minecraft.getMinecraft().thePlayer));
this.allowUserInput = false;
this.inventoryRows = chestInventory.getSizeInventory() / 9;
this.ySize = 114 + this.inventoryRows * 18;
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
this.fontRendererObj.drawString("Treasure Chest", 8, 6, 4210752);
}
/**
* Draws the background layer of this container (behind the items).
*/
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
}
}