Jump to content

Recommended Posts

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)?

Posted
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?

Posted
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

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

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