From c553531353d426b781536afa30700094909cc81b Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:07:23 -0700 Subject: [PATCH] fix test --- .../java/gregtech/api/capability/MultipleTankHandler.java | 6 ++++++ src/main/java/gregtech/api/recipes/logic/ParallelLogic.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/capability/MultipleTankHandler.java b/src/main/java/gregtech/api/capability/MultipleTankHandler.java index b6f6e133f06..55da71d8b3e 100644 --- a/src/main/java/gregtech/api/capability/MultipleTankHandler.java +++ b/src/main/java/gregtech/api/capability/MultipleTankHandler.java @@ -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 iterator() { return getFluidTanks().iterator(); diff --git a/src/main/java/gregtech/api/recipes/logic/ParallelLogic.java b/src/main/java/gregtech/api/recipes/logic/ParallelLogic.java index 1381086cefe..75189b98576 100644 --- a/src/main/java/gregtech/api/recipes/logic/ParallelLogic.java +++ b/src/main/java/gregtech/api/recipes/logic/ParallelLogic.java @@ -257,7 +257,7 @@ public static int limitParallelByItemsIncremental(@NotNull List 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; @@ -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; }