DrPlantabyte / PowerAdvantageAPI

API for Minecraft Forge 1.8 mods that have power systems
GNU Lesser General Public License v3.0
8 stars 2 forks source link

Power Advantage drain + EnderIO fluid tank crash #24

Closed OhiraKyou closed 8 years ago

OhiraKyou commented 8 years ago

Sucking water from a Power Advantage drain into an EnderIO fluid tank causes a crash then and on subsequent world loading attempts.

I am also posting this report to the EnderIO issues.

Data

Crash log Screenshots with steps Example world that crashes on load (489 KB)

Versions

Minecraft

EnderIO

Power Advantage

HenryLoenwind commented 8 years ago

oh yes, I see what's happening here:

    if(getTank().getFluidAmount() > 0 && getTank().getFluid().getFluid().equals(fluid.getFluid())){
        return getTank().drain(fluid.amount,forReal);
    } else {
        return new FluidStack(getTank().getFluid().getFluid(),0);
    }

That "else" won't work that well for an empty tank.

DrPlantabyte commented 8 years ago

Oops. I'll fix that soon. Thanks for the catch, HenryLoenwind. I wish fluid tanks were a little more deterministic in their behavior ("empty" tanks often, but not always, have a fluid stack) and didn't require so many null checks.

HenryLoenwind commented 8 years ago

Yes, those tank classes are not the best piece of software. In Ender IO we are subclassing them to make life a bit easier.

DrPlantabyte commented 8 years ago

Now fixed in version 2.2.2 (I think).