Had Enough Items

Had Enough Items

3M Downloads

TippedArrowRecipeMaker does not check if the recipe exists, it always shows the recipe

Atricos opened this issue ยท 4 comments

commented

Steps to Reproduce the Bug

  1. Add HEI and CraftTweaker to your modpack.
  2. Remove the Tipped Arrow recipe with CraftTweaker, for example: recipes.removeAll(); or recipes.remove(<minecraft:tipped_arrow>); or recipes.removeByInput(<minecraft:arrow>);.
  3. Launch the game.
  4. Click on any Tipped Arrow: HEI still shows the recipe (seen below), even though their crafting recipes don't work (also see below).

Expected Behavior

HEI shouldn't show the recipe, since it does not exist anymore.

HEI doesn't actually check if the recipe exists:
image

I think this is probably fixable by just adding an if clause:
if (recipeExists) {addRecipe();} instead of just addRecipe();

Actual Behavior

HEI still shows the recipe:
image

Even though the recipe doesn't work:
image

Version

I am using HadEnoughItems_1.12.2-4.25.0

commented
commented

Not JEI/HEI's fault.

CraftTweaker/CraftTweaker#844 (comment)

Let me reiterate: CraftTweaker removes the recipes perfectly, they cannot be crafted anymore, however they're still shown in JEI/HEI.

Moreover, looking at the quoted code segment, this is most likely JEI's/HEI's fault, as it does not check if the recipe exists, it adds the recipe regardless.

So I think the issue is most likely fixable by adding a clause like:
if (recipeExists) {addRecipe();} instead of just addRecipe();

commented

There is no way to ensure if the recipe exist since HEI cache recipe early before CT effectively removing it.
If you want to do it, instead trigger the recipe remove early before HEI start caching recipe.

commented

Use GroovyScript as recipe removal is sufficiently covered by it and reloads properly.