flow = 0;
if (cartNeedsFilling && (!needsPipe || pipeIsExtended())) {
FluidStack drained = tankManager.drain(0, RailcraftConfig.getTankCartFillRate(), false);
if (drained != null) {
flow = tankCart.fill(ForgeDirection.UP, drained, true);
tankManager.drain(0, flow, true);
}
}
if (flow > 0) {