Jump to content

Recommended Posts

Posted

So, as the title says, I have a "small" problem with configs and meta item IDs...

 

Without further prattling, here's the code that causes the error:

 

  Reveal hidden contents

 

And the specific error stuff:

 

  Reveal hidden contents

 

as you can see, the compiler decides to just give all three of my items the item ID "256" whenever I try to use a config file to determine them...

 

Any help is much appreciated, this is prohibiting me from doing science. ::)

Posted

your ID's are called before they are initialized in your config.(hence, as they are ints they take the default value of 0) you need to move your item constructor to some other method, maby make one labled add items then assign your varible it's value e.g:

 

public Item scienceMetaItem;

 

public static void addItems(){

    scienceMetaItem = new ItemScienceMetaItem(scienceMetaItemID).setItemName("Meta Item");

}

 

 

call this after your config has happend

Posted

Sadly, this did not work. I played around with the statics, too :/

 

 

Relevant code now:

 

  Reveal hidden contents

 

Oh, and error log:

 

  Reveal hidden contents

 

Posted

The void functions are called in the Init, so they're basically loaded there and then... and config file can only be opened in PreInit :/

Posted

Okay, I found the final mistake, thanks to diesieben's comment, which caused me to check if I was re-declaring them as different values in the PreInit... which was the case and I fixed it, thanks a lot  ;D

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.