BiggerSeries / Phosphophyllite

GNU Lesser General Public License v2.1
4 stars 5 forks source link

`PhosphophylliteFluidStack` `getFluid` problem #30

Closed Technici4n closed 1 year ago

Technici4n commented 1 year ago

We discussed this on FC, the gist is:

Then the following (AE2) code crashes because the returned fluid is 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