Skip to content

Conversation

@MrHell228
Copy link
Contributor

Current approach doesn't account for stacks that does not match any ingredient.
This results in recipe to match even if there are items that shouldn't be in it.

@aromaa
Copy link
Member

aromaa commented Oct 25, 2025

This should target API 12. Can we instead just use the vanilla StackedContents? Doing some quick testing, this seems to work.

@MrHell228
Copy link
Contributor Author

StackedContents approach seems to work in API 14.
In API 12 StackedContents is unparametrized and works with item integer ids so it's not possible to use it there.
I guess there should be 2 PRs, one to 12 with simple fix, and another to 14 with using StackedContents

@MrHell228 MrHell228 changed the title fix SpongeShapelessRecipe.matches fix SpongeShapelessRecipe.matches (API 14) Oct 25, 2025
@MrHell228 MrHell228 force-pushed the api-14-fix/sponge-shapeless-recipe branch from 8f422e1 to 562a059 Compare October 25, 2025 19:50
@MrHell228
Copy link
Contributor Author

Reworked matches method to use StackedContents

@MrHell228
Copy link
Contributor Author

To think about this more, it seems better to WrapOperation StackedItemContents#canCraft in ShapelessRecipe#matches instead of overriding in SpongeShapelessRecipe.
I would like to do this after merging recipe placing PR to not mess with merge conflicts a lot, and maybe it would be worth to use SpongeStackedItemContents in CraftingInputMixin

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants