Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Change Recipes with config


RaphGamingz
 Share

Recommended Posts

5 hours ago, RaphGamingz said:

how do i change recipes to make it harder if the config is set to true. 

You'll need to have a custom IRecipeSerializer(1.14) make sure to register it via the forge registry system.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

9 hours ago, RaphGamingz said:

so a class that implements IRecipeSerializer

...which needs to return an instance of a class that extends IRecipe<?> from one of its methods.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

8 hours ago, RaphGamingz said:

How do i do the recipe. they are loaded with a json file automatically. Do i write a condition in the file

You write an IRecipeSerializer you can base it off of vanilla's crafting one(s). Then you also need a IRecipe implementation that actually checks the config data for your mod when determining the result. So the IRecipeSerializer will do everything exactly the same as the vanilla one except it will load an extra piece from the json telling you which config data you need to access(your choice on how to implement that) and it needs to return a instance of your IRecipe implementation.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

On 10/25/2019 at 5:12 AM, RaphGamingz said:

How do i do the recipe. they are loaded with a json file automatically. Do i write a condition in the file

My solution is different from what the others are talking about. See Jabelar's tutorial on conditional recipes and follow the link he gives to Choonster's TestMod3 example. It's all laid out there. The basic idea is that you create a class that implements IConditionFactory to return true or false based on some value in your config file. Then you create a _factories file in your recipes folder. Then you add the condition into the recipe's json file.

This is all for 1.12.2. I haven't looked at newer versions and don't know if it works the same. What version are you working with?

Link to comment
Share on other sites

16 hours ago, Daeruin said:

This is all for 1.12.2. I haven't looked at newer versions and don't know if it works the same.

They are slightly different. There is no IConditionFactory as a matter of fact no need for one. You create an IRecipeSerializer(This is an IForgeRegistry thing) and return whatever IRecipe implementation you want there based on whatever you want in the JSON recipe.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

  • 1 month later...
On 10/27/2019 at 2:15 PM, Daeruin said:

My solution is different from what the others are talking about. See Jabelar's tutorial on conditional recipes and follow the link he gives to Choonster's TestMod3 example. It's all laid out there. The basic idea is that you create a class that implements IConditionFactory to return true or false based on some value in your config file. Then you create a _factories file in your recipes folder. Then you add the condition into the recipe's json file.

This is all for 1.12.2. I haven't looked at newer versions and don't know if it works the same. What version are you working with?

1.14

 

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.