Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

In my GUI class' drawBackground() method:

this.mc.renderEngine.func_110577_a(new ResourceLocation("plunderrummage", "textures/gui/disenchanter.png"));

 

In my recompiled, reobfuscated, zipped mod for the client, I have this setup:

PlunderRummage.zip > com > mod > plunderrummage > .class

PlunderRummage.zip > assets > plunderrummage > textures > gui > disenchanter.png, others. . .

PlunderRummage.zip > mcmod.info

 

I use that set up for ALL of my mods, and it works fine. If you're using the exact same directory and implementation, your textures should work.

hey guff, btw its a good practice to make resourcelocation 1 time and reuse the same object over and over, specially for something that is used every frame while drawing *thumb up* :)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

hey guff, btw its a good practice to make resourcelocation 1 time and reuse the same object over and over, specially for something that is used every frame while drawing *thumb up* :)

I do, I just used an object fill-in. I would assume he would use a field just the same since it's kind of a given.

Your package isn't lower case. :P

oooh geus wotn ower casing all my pakkages dint work .. i toght it wouldnt work but i said to myselve elts try it ..

 

but it dint make sence to me..

thx for leting me was 1 hour to rename all my pakkages names to lower case .. it dint work for the GUI texture ..

still dont understand why the Gui texture works in eclipse but not as eported mod ...

 

the locations sould be spot on becose eclipse makes it work :S ..

hey guff, btw its a good practice to make resourcelocation 1 time and reuse the same object over and over, specially for something that is used every frame while drawing *thumb up* :)

I do, I just used an object fill-in. I would assume he would use a field just the same since it's kind of a given.

 

oh ok, i was also thinking you were printing that for the example, but i wanted to make sure (im a efficiency whore :()

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • 3 weeks later...

I made a custom furnace that the GUI texture works fine in the eclispe minecraft, but when I open the furnace in regular minecraft it shows black and purple squares.

 

 

Custom GUI code.

 

package minecraftmod;

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

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class TutGuiFurnace extends GuiContainer
{
    private TileEntityDarkFurnace furnaceInventory;

    public TutGuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityDarkFurnace par2TileEntityFurnace)
    {
        super(new ContainerTutFurnace(par1InventoryPlayer, par2TileEntityFurnace));
        this.furnaceInventory = par2TileEntityFurnace;
    }

    /**
     * Draw the foreground layer for the GuiContainer (everything in front of the items)
     */
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        String s = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : StatCollector.translateToLocal(this.furnaceInventory.getInvName());
        this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
        this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
    }

    /**
     * Draw the background layer for the GuiContainer (everything behind the items)
     */
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.func_110434_K().func_110577_a(new ResourceLocation("titaniummod:/textures/gui/furnace.png"));<  This you want to change to  textures/gui/container/furnace.png.  Then make sure you have that directory in src/Minecraft/assets/yourmodname/(you have to create the assets folder)
        int k = (this.width - this.xSize) / 2;
        int l = (this.height - this.ySize) / 2;
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        int i1;

        if (this.furnaceInventory.isBurning())
        {
            i1 = this.furnaceInventory.getBurnTimeRemainingScaled(12);
            this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2);
        }

        i1 = this.furnaceInventory.getCookProgressScaled(24);
        this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
    }
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.