use of mekanism.common.capabilities.fluid.FluidTankWrapper in project Mekanism by mekanism.
the class LookingAtUtils method displayFluid.
private static void displayFluid(LookingAtHelper info, IFluidHandler fluidHandler) {
if (fluidHandler instanceof IMekanismFluidHandler) {
IMekanismFluidHandler mekFluidHandler = (IMekanismFluidHandler) fluidHandler;
for (IExtendedFluidTank fluidTank : mekFluidHandler.getFluidTanks(null)) {
if (fluidTank instanceof FluidTankWrapper) {
MergedTank mergedTank = ((FluidTankWrapper) fluidTank).getMergedTank();
CurrentType currentType = mergedTank.getCurrentType();
if (currentType != CurrentType.EMPTY && currentType != CurrentType.FLUID) {
// Skip if the tank is on a chemical
continue;
}
}
addFluidInfo(info, fluidTank.getFluid(), fluidTank.getCapacity());
}
} else {
// Fallback handling if it is not our fluid handler (probably never gets used)
for (int tank = 0; tank < fluidHandler.getTanks(); tank++) {
addFluidInfo(info, fluidHandler.getFluidInTank(tank), fluidHandler.getTankCapacity(tank));
}
}
}
Aggregations