use of mods.railcraft.common.carts.EntityLocomotiveSteam in project Railcraft by Railcraft.
the class TileFluidLoader method processCart.
@Override
protected void processCart(EntityMinecart cart) {
if (cart instanceof EntityLocomotiveSteam) {
EntityLocomotiveSteam loco = (EntityLocomotiveSteam) cart;
if (!loco.isSafeToFill()) {
retractPipe();
return;
}
}
AdvancedFluidHandler tankCart = getFluidHandler(cart, EnumFacing.UP);
if (tankCart == null)
return;
boolean cartNeedsFilling = cartNeedsFilling(tankCart);
if (cartNeedsFilling && needsPipe)
extendPipe();
else
retractPipe();
setProcessing(false);
if (cartNeedsFilling && (!needsPipe || pipeIsExtended())) {
FluidStack moved = FluidUtil.tryFluidTransfer(tankCart, tank, RailcraftConfig.getTankCartFillRate(), true);
setProcessing(Fluids.isNotEmpty(moved));
}
if (isProcessing())
setPowered(false);
if (cart instanceof IFluidCart)
((IFluidCart) cart).setFilling(isProcessing());
if (tankCart.isTankFull(tank.getFluidType()))
setResetTimer(RESET_WAIT);
}
Aggregations