MineMaarten / PneumaticCraft

PneumaticCraft source
Other
84 stars 50 forks source link

Wasn't able to load third party content #774

Closed Tsyklop closed 8 years ago

Tsyklop commented 8 years ago

http://pastebin.com/ywLajXAY

EnderIO-1.7.10-2.3.0.421_beta

PneumaticCraft-1.7.10-1.12.1-144

PrincessRTFM commented 8 years ago

Looks like it's (probably) an EnderIO problem.

java.lang.NullPointerException: Fluid can't be null!
[20:39:10] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at pneumaticCraft.common.PneumaticCraftAPIHandler.registerFuel(PneumaticCraftAPIHandler.java:187)
[20:39:10] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:  at pneumaticCraft.common.thirdparty.enderio.EnderIO.preInit(EnderIO.java:22)

EnderIO is trying to register a fluid fuel (probably for the fluid fueled compressor) but is passing null instead of a fluid object. I don't see what MineMaarten could do about this, so you're probably better off notifying the EnderIO dev(s) instead.

tterrag1098 commented 8 years ago

Uh, that's not what this means at all. Pneumaticraft is the one doing the registration of null... https://github.com/MineMaarten/PneumaticCraft/blob/master/src/pneumaticCraft/common/thirdparty/enderio/EnderIO.java#L22

PrincessRTFM commented 8 years ago

You're right, I misread it. That'll teach me not to double check. My bad.

Still, EIO is the one who registers hootch as a fluid. If it's not there, I don't see how PC could do anything about that.

XFactHD commented 8 years ago

PC could perform a null check before registering the fluid as fuel.

PrincessRTFM commented 8 years ago

And then the null check would be shifted to a different place. That exception is thrown as the result of a null check in the registration method.

XFactHD commented 8 years ago

Neither the API interface nor the FluidFuelManager class nor the third party class contains a null check. Or I am just blind.

PrincessRTFM commented 8 years ago

The pneumaticCraft.common.PneumaticCraftAPIHandler.registerFuel() method includes a null check on the first line:

if(fluid == null) throw new NullPointerException("Fluid can't be null!");
XFactHD commented 8 years ago

Yep, didn't see that. But I would say just throwing a null pointer exception is a bad idea because the fluid name could always change between versions. It could be logged as an error and tell the user that he should submit an issue so that MineMaarten can look into the problem and in the meantime the player can still use the rest of the EIO compatibility.

PrincessRTFM commented 8 years ago

I think throwing an NPE is the right way to go, because this is from the API and throwing an NPE is a reasonable way to inform the caller about the problem (or log it if the caller doesn't wrap it in a try/catch block). But maybe MineMaarten could wrap his own API calls from the compatibility handlers in try/catch blocks? That would keep the API the way it is (instead of potentially breaking mods that expect it to be the way it is) but still allow the rest of the EIO compat to function.

XFactHD commented 8 years ago

That's what I meant.