Fixed FluidUtil#tryFillContainer returning invalid result when simulating #9358

This commit is contained in:
brandon3055 authored and LexManos committed 2023-07-15 10:52:26 -07:00
1 parent cf3d42ef38
commit 37efd2b8ae
2 files changed
+33 -1

No files matched your search

@@ -147,7 +147,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();