use of com.simibubi.create.foundation.utility.animation.InterpolatedChasingValue in project Create by Creators-of-Create.
the class MountedFluidStorage method updateFluid.
public void updateFluid(FluidStack fluid) {
tank.setFluid(fluid);
if (!(te instanceof FluidTankTileEntity))
return;
float fillState = tank.getFluidAmount() / (float) tank.getCapacity();
FluidTankTileEntity tank = (FluidTankTileEntity) te;
if (tank.getFluidLevel() == null)
tank.setFluidLevel(new InterpolatedChasingValue().start(fillState));
tank.getFluidLevel().target(fillState);
IFluidTank tankInventory = tank.getTankInventory();
if (tankInventory instanceof SmartFluidTank)
((SmartFluidTank) tankInventory).setFluid(fluid);
}
Aggregations