package net.minecraftplus.mcp_ice_box; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; //@GuiDispenser @SideOnly(Side.CLIENT) public class GuiIceBox extends GuiContainer { private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); private final InventoryPlayer playerInventory; public IInventory dispenserInventory; public GuiIceBox(InventoryPlayer playerInv, IInventory dispenserInv) { super(new ContainerIceBox(playerInv, dispenserInv)); this.playerInventory = playerInv; this.dispenserInventory = dispenserInv; } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { String s = this.dispenserInventory.getDisplayName().getUnformattedText(); this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(dispenserGuiTextures); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); } }