Posted August 25, 20196 yr 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)?
August 25, 20196 yr Author Just now, diesieben07 said: Recipes are created via JSON. So I should create JSON files at runtime?
August 25, 20196 yr 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?
August 25, 20196 yr 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
August 25, 20196 yr 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.