Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

In my attempt to make a mod for configuring the CraftingManager's recipe list from the convenience of a configuration file, I've repeatedly worked around less than ideal circumstances. However, I find myself stuck on an especially cantankerous problem.

 

Parsing data from the Configuration file to fill a recipe list is trivial compared to putting information there representing the initial state. Attempts at crawling through the recipe list, with the intent to build a string encoding the recipe instance's field values in a way that allows me to construct them, is hacky, but worse I have been unable to make it work.

 

If one could magically get the argument values for the constructors, that would be perfect. In lieu of that ideal scenario, I figured getting the field values from instances would make a fine alternative, given that most of the IRecipe-implementing classes plop their constructor arguments into their field members. Ugly, but doable; even the OreRecipes comply. Fields can't be relied upon to be public, constructors aren't magic, so I'm left with reflection.

 

And here, I plant my face into a wall. Making a class field crawler both generic and useful has worn on my patience. I seek suggestions on how I might solve the problem; perhaps I've overlooked a more elegant solution, or maybe someone can elucidate on how I might crawl the class fields. If not, I'll be forced to resort to a less savory approach like not dumping the initial recipe list to the configuration file.

If you only want the user to add recipes I would suggest using XML or JSON rather than an configuration file, as deleting recipes would be more work.

No 5 row long documentation = account on the help forums

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.