Jump to content

Recommended Posts

Posted

I have an item, called booPowder, which for some reason is not appearing in the creative inventory - the only way to obtain it is with the give command. This item is the icon of the creative tab MCMario.CREATIVE_TAB, the tab it should appear in, proving that its texture and everything is linked properly. I also have a block, called mushroomPortalFrame, which displays perfectly.

Here is my code:

 

  Reveal hidden contents

 

Any suggestions as to why the item is not appearing in the creative inventory?

  Quote

  Quote
catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Posted

Sorry about the code, is there a tutorial on how to fix that?

 

So, I expect I should initialize my creative tab in my init method? I'll try that now. Thx

  Quote

  Quote
catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Posted

Yes I know what a static initializer is, I just overlooked that problem. To my understanding as long as the creative tab is instantiated before it is set to the item, it will work, I'm just compiling and running now to test...

  Quote

  Quote
catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Posted

Okay so I changed my init method to a preinit and the FMLInitializationEvents to FMLPreInitializationEvents. It appears to be more complicated than I thought. Thanks for your contribution!

  Quote

  Quote
catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • 4 months later...
Posted

Yes, it's solved now. One thing I've learnt is to avoid using static initializers and instead use methods, as otherwise you can get bugs which are very hard to debug.

  Quote

  Quote
catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

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.