SanAndreaP Posted November 6, 2012 Posted November 6, 2012 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: https://dl.dropbox.com/u/56920617/random%20stuff/2012-11-06_14.22.34.png[/img] And here is one in a modified Minecraft: https://dl.dropbox.com/u/56920617/random%20stuff/2012-11-06_14.23.03.png[/img] Quote 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.
Recommended Posts
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.