Skip to content

Comments

fix recurseIngredientTreeAdd returning true on conflicts#2090

Merged
TechLord22 merged 2 commits intomasterfrom
tc-fix-recipe-tree
Sep 23, 2023
Merged

fix recurseIngredientTreeAdd returning true on conflicts#2090
TechLord22 merged 2 commits intomasterfrom
tc-fix-recipe-tree

Conversation

@TechLord22
Copy link
Member

What

Fixes RecipeMap#recurseIngredientTreeAdd returning true on a recipe conflict. This would lead to the conflicting recipe still being added to its category, which would then show up in JEI despite not being present in the search tree.

Implementation Details

When an existing recipe (left branch) is found during addition, it is kept in the map. This value was then checked for presence (indicating a recipe was added) but never validated that the recipe was actually the one attempting to be added. This resulted in false-positive addition success. This also meant that the paths to conflicting recipes would not be removed from the search tree, leading to extra memory consumption.

Outcome

Fixes conflicting recipes showing in JEI despite not being registered.

@TechLord22 TechLord22 added the type: bug Something isn't working label Sep 23, 2023
@TechLord22 TechLord22 requested a review from a team as a code owner September 23, 2023 19:18
@TechLord22 TechLord22 merged commit da171a7 into master Sep 23, 2023
@TechLord22 TechLord22 deleted the tc-fix-recipe-tree branch September 23, 2023 19:35
Gebardensprache added a commit to ChildCommunitCN/GregTech-ChildHappyEdition that referenced this pull request Sep 24, 2023
fix recurseIngredientTreeAdd returning true on conflicts (GregTechCEu#2090)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants