mangoose Posted May 2, 2017 Share Posted May 2, 2017 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 Quote Link to comment Share on other sites More sharing options...
Matryoshika Posted May 2, 2017 Share Posted May 2, 2017 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()) Quote 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 More sharing options...
mangoose Posted May 2, 2017 Author Share Posted May 2, 2017 In undo, I do want to add the recipe, because that is meant to undo the removal of the recipe. The null checks I can get rid of, but they should'nt be causing any problems Quote Link to comment Share on other sites More sharing options...
Matryoshika Posted May 2, 2017 Share Posted May 2, 2017 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. Quote 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 More sharing options...
mangoose Posted May 2, 2017 Author Share Posted May 2, 2017 yeah, I can't craft the items when I remove the recipe, the recipe still shows in jei, though Quote Link to comment Share on other sites More sharing options...
mangoose Posted May 2, 2017 Author Share Posted May 2, 2017 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 Quote Link to comment Share on other sites More sharing options...
larsgerrits Posted May 3, 2017 Share Posted May 3, 2017 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. Quote 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 More sharing options...
Recommended Posts
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.