Closed Technici4n closed 1 year ago
We discussed this on FC, the gist is:
amount != 0
isEmpty
public final Fluid getFluid() { return isEmpty ? Fluids.EMPTY : fluidDelegate.get(); }
Then the following (AE2) code crashes because the returned fluid is Fluids.EMPTY:
Fluids.EMPTY
FluidStack fluidStack = fluidHandler.getStackInSlot(...); if (fluidStack.isEmpty()) { return null; } var newStack = new FluidStack(fluidStack.getFluid(), 1); newStack.setTag(fluidStack.getTag()); // Crashes: can't modify empty
We discussed this on FC, the gist is:
amount != 0
isEmpty
is true even though the stack is not emptyThen the following (AE2) code crashes because the returned fluid is
Fluids.EMPTY
: