List<Pair<TileEntity,ForgeDirection>> list = getAdjacentTanks(true);
for(Pair<TileEntity,ForgeDirection> pair:list) {
if(pair.getValue1() instanceof LogisticsTileGenericPipe) {
if(((LogisticsTileGenericPipe)pair.getValue1()).pipe instanceof CoreRoutedPipe) continue;
}
FluidTank tank = ((PipeFluidTransportLogistics)this.transport).sideTanks[pair.getValue2().ordinal()];
validDirections++;
if(tank.getFluid() == null) continue;
int filled = ((IFluidHandler)pair.getValue1()).fill(pair.getValue2().getOpposite(), tank.getFluid().copy(), true);
if(filled == 0) continue;
FluidStack drain = tank.drain(filled, true);
if(drain == null || filled != drain.amount) {
if(LPConstants.DEBUG) {
throw new UnsupportedOperationException("Fluid Multiplication");
}
}
}
if(validDirections == 0) return;
FluidTank tank = ((PipeFluidTransportLogistics)this.transport).internalTank;
FluidStack stack = tank.getFluid();
if(stack == null) return;
for(Pair<TileEntity,ForgeDirection> pair:list) {
if(pair.getValue1() instanceof LogisticsTileGenericPipe) {
if(((LogisticsTileGenericPipe)pair.getValue1()).pipe instanceof CoreRoutedPipe) continue;
}
FluidTank tankSide = ((PipeFluidTransportLogistics)this.transport).sideTanks[pair.getValue2().ordinal()];
stack = tank.getFluid();
if(stack == null) continue;
stack = stack.copy();
int filled = tankSide.fill(stack , true);
if(filled == 0) continue;
FluidStack drain = tank.drain(filled, true);
if(drain == null || filled != drain.amount) {
if(LPConstants.DEBUG) {
throw new UnsupportedOperationException("Fluid Multiplication");