Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Dec 27, 2024
1 parent bc86ecd commit c553531
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public final int getIndexOfFluid(@Nullable FluidStack fluidStack) {
return -1;
}

public int simulateFill(FluidStack stack, int amount) {
var insertable = stack.copy();
insertable.amount = amount;
return fill(insertable, false);
}

@Override
public final @NotNull Iterator<Entry> iterator() {
return getFluidTanks().iterator();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gregtech/api/recipes/logic/ParallelLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static int limitParallelByItemsIncremental(@NotNull List<ItemStack> recip
* voiding products.
*/
public static int limitParallelByFluids(@NotNull Recipe recipe,
@NotNull MultipleTankHandler overlayedFluidHandler, int multiplier) {
@NotNull MultipleTankHandler tankHandler, int multiplier) {
int minMultiplier = 0;
int maxMultiplier = multiplier;

Expand All @@ -273,7 +273,7 @@ public static int limitParallelByFluids(@NotNull Recipe recipe,
} else {
amountLeft = fluidStack.amount * multiplier;
}
int inserted = overlayedFluidHandler.fill(fluidStack, false);
int inserted = tankHandler.simulateFill(fluidStack, amountLeft);
if (inserted > 0) {
amountLeft -= inserted;
}
Expand Down

0 comments on commit c553531

Please sign in to comment.