Jump to content

Custom tab background not working in actual Minecraft


SanAndreaP

Recommended Posts

Hello,

 

I wanted to add a custom background and searched a bit tin the source. The new tab works flawless with the default background. In eclipse, the background I'll use works, too. But as soon as I pack my mod into a jar file and try to use it in a modded Minecraft, the background seems missing the texture. I made sure the image is in the right place. I don't know how to solve this.

 

This is the path, where my background is in:

JARFILE/SanAndreasP/mods/ClaySoldiersMod/claymans/CSM_TabBG.png

 

This is the path defined in the source:

public static final String CSMTAB_TEXTURE = "../../SanAndreasP/mods/ClaySoldiersMod/claymans/CSM_TabBG.png";

I have to go 2 times back in the path, because in the source, the GuiContainerCreative class takes the custom background path for a tab as following:

        CreativeTabs var5 = CreativeTabs.creativeTabArray[selectedTabIndex];
        int var6 = this.mc.renderEngine.getTexture("/gui/creative_inv/" + var5.getBackgroundImageName());

 

I've preloaded it, too (path defined like in the GuiContainerCreative; code from ClientProxy):

MinecraftForgeClient.preloadTexture("/gui/creative_inv/" + CSMModRegistry.CSMTAB_TEXTURE);

 

And the texture is registered in the tab as following:

claySoldierTab.setBackgroundImageName(this.CSMTAB_TEXTURE);

 

I can live without custom tab background, but it would be nice if it would work, though.

 

Here is a screenshot within eclipse:

 

 

 

And here is one in a modified Minecraft:

 

 

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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