Fixed FluidUtil#tryFillContainer returning invalid result when simulating #9358

This commit is contained in:
brandon3055 authored and LexManos committed 2023-07-15 10:51:17 -07:00
1 parent 1ee53c0464
commit 09bc73d5cd
2 files changed
+33 -1

No files matched your search

@@ -146,7 +146,9 @@ public class FluidUtil
}
else
{
containerFluidHandler.fill(simulatedTransfer, IFluidHandler.FluidAction.SIMULATE);
// We are acting on a COPY of the stack, so performing changes on the source is acceptable even if we are simulating.
// We need to perform the change otherwise the call to getContainer() will be incorrect.
containerFluidHandler.fill(simulatedTransfer, IFluidHandler.FluidAction.EXECUTE);
}
ItemStack resultContainer = containerFluidHandler.getContainer();