Jump to content

[1.12.2] Changing the ingredients of a vanilla crafting recipe


Recommended Posts

Posted

So I want to replace the recipes of furnace and stone tools and make them require a new, more expensive material I created.

 

I managed to remove the recipes by replacing them with a dummy recipe, using a code like this:

public static void removeRecipes() {
			 ForgeRegistry<IRecipe> recipeRegistry = (ForgeRegistry<IRecipe>)ForgeRegistries.RECIPES;
		        @SuppressWarnings("deprecation")
				ArrayList<IRecipe> recipes = Lists.newArrayList(recipeRegistry.getValues());
		        
		        for (IRecipe r : recipes)
	            {
	                ItemStack output = r.getRecipeOutput();
	                if (output.getItem() == Item.getItemFromBlock(Blocks.FURNACE))
	                {
	                    recipeRegistry.remove(r.getRegistryName());
	                    recipeRegistry.register(DummyRecipe.from(r));
	                }
	            }
		}

 

I have also created my own furnaceJ.json file with the new recipe, however this recipe seems to also be overriden by the dummy recipe.

 

I read that the solution is to register my own recipe instead of the dummy one in this line:

recipeRegistry.register(DummyRecipe.from(r));

 

But... how can I do it? My recipe is saved in a .json file, not in a .java file like the Dummy recipe.

 

I know the solution is probably very simple but I just can't see it.

Posted
21 hours ago, diesieben07 said:

Check if the registry name of the recipe is the vanilla recipe before removing it.

How can I do that? Is there any method for that?

Posted
2 minutes ago, diesieben07 said:

You are already calling it:

 

I know I should be using something like if (r.getRegistryName() == ???)

 

But I don't know how the vanilla recipe is called

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • seguridad seguridad
    • I am creating a server with mods but when i try tostart it it say in the logs:   [29Jan2025 20:36:50.715] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/fmlcore/1.20.1-47.3.27/fmlcore-1.20.1-47.3.27.jar is missing mods.toml file 159[29Jan2025 20:36:50.717] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar 160[29Jan2025 20:36:50.717] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar is missing mods.toml file 161[29Jan2025 20:36:50.718] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar 162[29Jan2025 20:36:50.718] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar is missing mods.toml file 163[29Jan2025 20:36:50.719] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar 164[29Jan2025 20:36:50.719] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar is missing mods.toml file
    • How do you configure the entity reach of a custom weapon? Asking for 1.21 Minecraft parchment
    • This topic is over a year old. If you are having an issue, please read the FAQ for the proper way to post logs, and create your own thread.
    • hello i have been trying to put this specific pack for a while now but ive been hit with a new error everytime. no matter if its a previous version or if i change the pack format it will just not work please help latest log:https://mclo.gs/b6Qra5d <----- this is with pack version 1.20 no changes done to it debug log: https://mclo.gs/jczkfRK
  • Topics

×
×
  • Create New...

Important Information

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