Railcraft

Railcraft

34M Downloads

canFill and canDrain fault on boilers

Vectrobe opened this issue ยท 5 comments

commented

canFill and canDrain are not correctly implemented or bugged on boilers, they don't cause crashes or errors but simply only function correctly for the first tank, the water, and don't work at all for the fuel and steam tanks.

this causes a compatibility issue with at least MFR plastic pipes as they are dependant on the functions to work correctly.

commented

Fuel and Steam Tanks? What are those?

As for the Boiler, I'll admit the Fluid Boilers might not correctly accept fuels, but please explain how this is wrong for the Solid Boilers:

    @Override
    public boolean canFill(ForgeDirection from, Fluid fluid) {
        return Fluids.WATER.is(fluid);
    }

    @Override
    public boolean canDrain(ForgeDirection from, Fluid fluid) {
        return Fluids.STEAM.is(fluid);
    }
commented

the 3 tanks in the boiler tiles, for a fluid boiler that is, a solid of course would only have two.

as for the code there, canDrain is obviously going to return false if the fluid supplied is not the steam in the boiler...

commented

if(fluid)
return Fluids.STEAM.is(fluid);
else
return [is tank not empty?]

commented

Ah, I think I see what you are saying. Thanks, I'll see about getting that fixed tomorrow.

commented

ok weird, went do do more testing again and the steam extraction is suddenly working perfectly fine, not sure if I somehow overlooked something there or what...

I guess then the .is() check already has a null check in it and thus canDrain doesn't need changing, though the canFill for fluid boilers is definitely still broken.

return Fluids.WATER.is(fluid) || fuelAcceptionFunction(fluid);
might be all that's needed for that one...