Jump to content

[1.11.2] Can't remove a recipe from jei when it is removed with crafttweaker


mangoose

Recommended Posts

I have added JEI integration to my mod, and I'm working on crafttweaker integration. I got it working for one process, the crushing tub, but recipes that are removed still show up in JEI. The method in Crafttweaker's api to remove jei recipes doesn't work, whether I pass it a recipe, or a recipe wrapper. I tried using the instance of jei's recipe registry to remove the recipe directly using more up to date methods, but that didn't work either.

 

Here is the package with my classes for jei and crafttweaker compat

Link to comment
Share on other sites

I think you're doing the opposite of what you want here.
Also, you're doing redundant null-checks. The list will never be null, because you're initializing it as an empty arraylist.
A for-each-loop will also only run if the collection contains anything (here, if !list.isEmpty())

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Ah, missed that.
Are you sure that the Recipes.crushingTubRecipes is altered when you call it.remove in apply?

If the recipe is properly removed from your own recipes, then you may need to forcefully remove the wrapper for this recipe in JEI manually.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Upon further testing, it seems impossible for me to remove recipes at all.

 

@Override
    public void onRuntimeAvailable(IJeiRuntime iJeiRuntime) {
        recipeRegistry = iJeiRuntime.getRecipeRegistry();
        for (CrushingTubRecipe r : Recipes.crushingTubRecipes) {
            recipeRegistry.removeRecipe(new CrushingTubRecipeWrapper(r), "rustic.crushing_tub");
            recipeRegistry.removeRecipe(r);
            recipeRegistry.removeRecipe(new CrushingTubRecipeWrapper(r));
        }
    }

 

does nothing, even though though I know the loop is succesfully calling the methods on all the crushing tub recipes

Link to comment
Share on other sites

recipeRegistry.removeRecipe(new CrushingTubRecipeWrapper(r));

Well, you are removing a new wrapper, so that will never work. You should save the instances of the original recipe and wrapper classes and use those, don't bother removing them and just disable them in the recipe/wrapper classes.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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



×
×
  • Create New...

Important Information

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