com.dechiridas.letsmod.client.gui.inventory.GuiGenericFurnace.java Source code

Java tutorial

Introduction

Here is the source code for com.dechiridas.letsmod.client.gui.inventory.GuiGenericFurnace.java

Source

package com.dechiridas.letsmod.client.gui.inventory;

import org.lwjgl.opengl.GL11;

import com.dechiridas.letsmod.inventory.ContainerGenericFurnace;
import com.dechiridas.letsmod.lib.Textures;
import com.dechiridas.letsmod.tileentity.TileEntityGenericFurnace;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;

/**
 * LetsMod Mod
 *
 * GuiGenericFurnace
 *
 * @author dechiridas
 * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
 */

public class GuiGenericFurnace extends GuiContainer {
    public GuiGenericFurnace(InventoryPlayer inventoryPlayer, TileEntityGenericFurnace tileEntity) {
        super(new ContainerGenericFurnace(inventoryPlayer, tileEntity));
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
        // Draw your GUI here, only thing you need to change is the path
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.renderEngine.bindTexture(Textures.GUI_GENERIC_FURNACE);
        int xStart = (width - xSize) / 2;
        int yStart = (height - ySize) / 2;
        this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int param1, int param2) {
        // Draw text and stuff here
        // The parameters for drawString are: string, x, y, color
        fontRenderer.drawString("Generic Furnace", 8, 6, 4210752);

        // Draws "Inventory" or your regional equivalent
        fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
    }

}