TileFissionPort returns null for fluid capability, yet returns true for hascapability
Thutmose opened this issue ยท 5 comments
The following is the crash from immersive Engineering:
https://gist.github.com/Thutmose/c19df26a9bef5097ed9e524435b62d25
Or this one:
https://gist.github.com/Thutmose/ed0c56178322ecb082b85189589599b1
They are caused by TileFissionPort overriding getCapability, but not hasCapability. Here you return null for the fluid capability:
https://github.com/turbodiesel4598/NuclearCraft/blob/master/src/main/java/nc/tile/dummy/TileFissionPort.java#L216
Yet here you return true for the request for it:
https://github.com/turbodiesel4598/NuclearCraft/blob/master/src/main/java/nc/tile/energyFluid/TileEnergyFluidInventory.java#L221
This causes the above crashes.
Edit: I tested replacing the return null in TileFissionPort.getCapability with return super.getCapability (which it should do anyway incase another mod adds capabilities to the fission port) and it worked as intended, no fluids went in/out, and the above crash didn't occur.
Yep, you're right - it should not be returning null. Will check through the rest of the machine classes to check there aren't similar errors.
Fixed this as well as all the other potential crashes caused by similar mistakes throughout the code :P
Ya I had noticed this one while trying to add some of the CommonCapabilities caps to your tiles for my test server.
I then noticed #184 when I placed a pipe next to a fission port