Skip to content

Commit

Permalink
fix fluid pipes converting an empty fluidstack to an (illegal) null (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Mar 26, 2024
1 parent b3ef8a3 commit 67750c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public void restoreFromSnapshot(Object snapshot) {
@Nullable
@Override
public FluidStack drain(FluidStack fluidStack, boolean doDrain) {
if (fluidStack == null || fluidStack.getAmount() <= 0) return null;
if (fluidStack.isEmpty() || fluidStack.getAmount() <= 0) return FluidStack.empty();
fluidStack = fluidStack.copy();
for (FluidStorage tank : tanks) {
FluidStack drained = tank.drain(fluidStack, doDrain);
if (!drained.isEmpty()) return drained;
}
return null;
return FluidStack.empty();
}

@Override
Expand Down

0 comments on commit 67750c5

Please sign in to comment.