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

Hello again,

 

So I figured out my mineral registry and now I want to add a furnace recipe for each one of them, I made a Function<Mineral, FurnaceRecipe> which I use in this method to create the recipes;

	public FurnaceRecipe[] getMeltingRecipes(){
		return getMinerals().stream().map(Transformers.DUST_INGOT_TRANSFORMER).collect(Collectors.toList()).toArray(new FurnaceRecipe[0]);
	}

Now this works but I have no clue on how to register those recipes, which method should I call / what class should I override and when(which event)?

  • Author
Just now, diesieben07 said:

Recipes are created via JSON.

 

So I should create JSON files at runtime?

  • Author
Just now, diesieben07 said:

No, not at runtime. The point of the data system is that things like recipes are not created at runtime. 

That's the whole problem I'm trying to dynamically add recipes; is there any reason why this isn't possible?

  • Author
2 minutes ago, diesieben07 said:

Define "dynamically". What is the reason you cannot create a JSON file for each recipe? 

At runtime there's a registry for minerals, the amount of minerals depends on config and other mods invoking this registry, I could force them to make their own recipes but I'm trying to make it so there's only one line required and my mod takes care of the rest

  • Author
2 minutes ago, diesieben07 said:

You can make your own IRecipeSerializer (it's just a registry entry) and then use the type field in your recipe JSON to select that serializer. This serializer can then produce a custom recipe implementation which handles all cases. 

OK, Thx! I'll do that

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.