Fixed fluid autocrafting breaking when using 2 stacks of the same fluid in a pattern.

Cherry picked from 69753592358a0e361a4e392770e12e6d61e1519b
This commit is contained in:
Darkere
2022-01-22 17:29:28 +01:00
committed by raoulvdberge
parent e53ad61d59
commit 2ff06d379e
2 changed files with 2 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Processing patterns now use the order of items/fluids specified in the pattern - Processing patterns now use the order of items/fluids specified in the pattern
by [@necauqua](https://github.com/necauqua) and [@Darkere](https://github.com/Darkere). by [@necauqua](https://github.com/necauqua) and [@Darkere](https://github.com/Darkere).
- Fixed autocrafting task getting stuck if two tasks fulfilled each others requirements. - Fixed autocrafting task getting stuck if two tasks fulfilled each others requirements.
- Fixed fluid autocrafting breaking when using 2 stacks of the same fluid in a pattern.
## [v1.10.0-beta.4] - 2021-12-28 ## [v1.10.0-beta.4] - 2021-12-28

View File

@@ -257,7 +257,7 @@ public class CraftingCalculator {
FluidStack fromSelf = fluidResults.get(possibleInput, IComparer.COMPARE_NBT); FluidStack fromSelf = fluidResults.get(possibleInput, IComparer.COMPARE_NBT);
FluidStack fromNetwork = fluidStorageSource.get(possibleInput, IComparer.COMPARE_NBT); FluidStack fromNetwork = fluidStorageSource.get(possibleInput, IComparer.COMPARE_NBT);
int remaining = possibleInput.getAmount() * qty; int remaining = ingredient.getCount() * qty;
if (remaining < 0) { // int overflow if (remaining < 0) { // int overflow
throw new CraftingCalculatorException(CalculationResultType.TOO_COMPLEX); throw new CraftingCalculatorException(CalculationResultType.TOO_COMPLEX);