Skip to content

Fix ToolHeadReplaceRecipe.matches() for non-existent material+tier combos#4809

Merged
gustovafing merged 1 commit into
GregTechCEu:1.20.1from
Mqrius:feature/fix-toolheadreplacerecipe-matches
Apr 23, 2026
Merged

Fix ToolHeadReplaceRecipe.matches() for non-existent material+tier combos#4809
gustovafing merged 1 commit into
GregTechCEu:1.20.1from
Mqrius:feature/fix-toolheadreplacerecipe-matches

Conversation

@Mqrius
Copy link
Copy Markdown
Contributor

@Mqrius Mqrius commented Apr 23, 2026

What

Fixes #4807

See #4807 for details

Outcome

Verifies GTMaterialItems.TOOL_ITEMS.get(toolHead.material(), output[tool.getElectricTier()]) != null before returning true from matches

How Was This Tested

Game runs, doesn't NPE when putting a wirecutter head and a wirecutter in the crafting grid where the wirecutter head material doesn't work with the wirecutter's tier

@gustovafing gustovafing merged commit d13fbd7 into GregTechCEu:1.20.1 Apr 23, 2026
4 of 5 checks passed
@screret
Copy link
Copy Markdown
Contributor

screret commented Apr 23, 2026

I think this fix might not work if the tool item is replaced via unification
Though I don't remember if that's possible to do...

@Mqrius
Copy link
Copy Markdown
Contributor Author

Mqrius commented Apr 23, 2026

Not sure what unification is or what you mean by that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolHeadReplaceRecipe.matches() passes combos that assemble() can't handle leading to NPE

3 participants