Skip to content

Fix item count in chancedInput and chancedOutput#4709

Merged
gustovafing merged 3 commits intoGregTechCEu:1.20.1from
TonyCrane:fix/chancedRecipe
Mar 24, 2026
Merged

Fix item count in chancedInput and chancedOutput#4709
gustovafing merged 3 commits intoGregTechCEu:1.20.1from
TonyCrane:fix/chancedRecipe

Conversation

@TonyCrane
Copy link
Contributor

What

In #4202, the type of the first parameter of chancedInput and chancedOutput is changed from ItemStack to Ingredient. But Ingredient is a vanilla class which doesn't have count. So all chanced input and output with count is truncated to 1. And the ore processing has byproduct multiplier and some modpack author also use this api to write new recipes which have chanced output with count, so this bug should be fixed.

98d8676fb6cbcba0840ec0bea2089f56 c4837421592fc27c9810f87d0b9ca273

Implementation Details

Use SizedIngredient instead of Ingredient as the parameters.

Outcome

7680ad9b57925f52d89ef6c7dddbe23f

@TonyCrane TonyCrane requested a review from a team as a code owner March 3, 2026 05:16
@github-actions github-actions bot added the 1.20.1 label Mar 3, 2026
@gustovafing
Copy link
Member

sized ingredient is a subclass of ingredient, so it works

@screret
Copy link
Contributor

screret commented Mar 23, 2026

@gustovafing the real fix is that 2nd change, which does mean the size information is currently deleted.
It won't work if you do chancedOutput(itemStackHere, 5000) for example

@gustovafing gustovafing reopened this Mar 24, 2026
@TonyCrane
Copy link
Contributor Author

@gustovafing reverted

@gustovafing gustovafing merged commit c83e43b into GregTechCEu:1.20.1 Mar 24, 2026
4 checks passed
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.

3 participants