Jump to content

Recommended Posts

Posted

When manipulating the Configuration data structure I can set a property on an entry to tell the Gui system what IConfigElement class to use when manipulating that property.  I don't see anything like that available for the Config annotation system that Forge provides.  I was wondering is if I am overlooking something, or if indeed the annotation system cannot do this if it could be added.  My thought would be a new annotation on a Config property where I could specify the class name, and the annotation process would do the magic to set property on the config element.

 

If that is not possible adding a pre/post event for config processing could be useful.  In the pre I could set the the IConfigElement property appropriately and perhaps modify the structure somewhat  better fit presentation, and on the post it has the potential of doing post processing before being persisted.

Posted

You can get a Configuration for your mod by using ConfigManager.getConfiguration. If you haven't specified the name in your @Config annotation then it will be equal to your modid. That configuration will contain all categories/properties you've specified in your annotation-based config and you can do whatever you want with it just as you would with a normal Configuration.

Posted

From what I can tell annotation-based configs are created and injected when the mod is constructed. So even as early as pre-init should be fine. I've just debugged it and can confirm that the configuration indeed exists at preinit.

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.