    001package net.minecraft.client.gui.inventory;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.entity.player.InventoryPlayer;
    006import net.minecraft.inventory.ContainerDispenser;
    007import net.minecraft.tileentity.TileEntityDispenser;
    008import net.minecraft.util.StatCollector;
    009import org.lwjgl.opengl.GL11;
    010
    011@SideOnly(Side.CLIENT)
    012public class GuiDispenser extends GuiContainer
    013{
    014    public TileEntityDispenser field_94078_r;
    015
    016    public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser)
    017    {
    018        super(new ContainerDispenser(par1InventoryPlayer, par2TileEntityDispenser));
    019        this.field_94078_r = par2TileEntityDispenser;
    020    }
    021
    022    /**
    023     * Draw the foreground layer for the GuiContainer (everything in front of the items)
    024     */
    025    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    026    {
    027        String s = this.field_94078_r.isInvNameLocalized() ? this.field_94078_r.getInvName() : StatCollector.translateToLocal(this.field_94078_r.getInvName());
    028        this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
    029        this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
    030    }
    031
    032    /**
    033     * Draw the background layer for the GuiContainer (everything behind the items)
    034     */
    035    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    036    {
    037        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    038        this.mc.renderEngine.bindTexture("/gui/trap.png");
    039        int k = (this.width - this.xSize) / 2;
    040        int l = (this.height - this.ySize) / 2;
    041        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    042    }
    043}