Jump to content

Nested configuration


LegendLength

Recommended Posts

I'm creating a mod that allows a mod pack author to create a book in minecraft.  The book can contain images which are specified by the mod pack author via a configuration file.

 

The configuration has a list of pages, each page has an image file name and information like margin size and other layout properties.  My problem is the standard forge configuration format doesn't seem to support arrays in this way.

 

I realize you can still have nested configuration like:

 

page.page1

page.page2

page.page3

 

But I would prefer a style of:

 

pages

{

  { [properties for page 1] }

  { [properties for page 2] }

  etc.

}

 

Where the user doesn't need to name each section explicitly using 'page1', 'page2' etc..  Just because it adds a burden to the user when they want to shift pages around.

 

So i've implemented it in Json instead but I would prefer to use normal forge config files for 2 reasons:

 

1. Forge configuration style is standard across nearly all mods.

2. Json doesn't allow comments, incredibly.

 

Let me know if that was too vague.

Link to comment
Share on other sites

Firstly I apologize for initially posting in the wrong forum.

 

I tried looking through the category code for forge, and also example configs, but couldn't find a way to do it apart from forcing the user to label each category with a unique name.

 

For example if they want 8 pages in the book they would have to make 8 categories with unique names:

 

category1:

category2:

...

category8:

 

What I am after is a way for them to create an 'array' of categories where the name is not required.  So:

 

pages:

{ page 1 configuration data}

{ page 2 configuration data}

...

{ page 8 configuration data}

 

In the latter case they can just rearrange the pages without the need to rename every category (which could get annoying for a 50 page book).

Link to comment
Share on other sites

Yes, it has to be unique names.

There is no object nesting. The forge config system is VERY basic {but a fucking hell to maintain code wise u.u never touching it again if i can help it}

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.