// center tank
if (tanks == null || tanks[0] == null || tanks[0].fluid == null || tanks[0].fluid.amount == 0)
return true;
Fluid fluidInTank = tanks[0].fluid.getFluid();
boolean[] validDirections = new boolean[ForgeDirection.values().length];
boolean[] filteredDirections = new boolean[ForgeDirection.values().length];
boolean filterForLiquid = false;
// check every direction
// perhaps we should/can cache this?
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
validDirections[dir.ordinal()] = false;
filteredDirections[dir.ordinal()] = false;
if (Utils.checkPipesConnections(container.getTile(dir), container)) {
for (int slot = 0; slot < 9; ++slot) {
Fluid fluid = fluids[dir.ordinal() * 9 + slot];
if (fluid != null) {
filteredDirections[dir.ordinal()] = true;
if (fluidInTank.getID() == fluid.getID()) {
validDirections[dir.ordinal()] = true;
filterForLiquid = true;
}
}
}