if (oxygenTile.shouldPullOxygen())
{
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity tile = new BlockVec3(tileEntity).modifyPositionFromSide(direction, 1).getTileEntity(tileEntity.getWorldObj());
if (oxygenTile.canConnect(direction, NetworkType.OXYGEN) && this.pipes.contains(tile))
{
float oxygenToSend = Math.max(totalOxygen, totalOxygen * (oxygenTile.getOxygenRequest(direction) / totalOxygenRequest));
if (oxygenToSend > 0)
{
remainingUsableOxygen -= oxygenTile.receiveOxygen(direction, oxygenToSend, true);
}
}
}
}
}
else if (EnergyConfigHandler.isMekanismLoaded() && tileEntity instanceof IGasHandler)
{
IGasHandler gasHandler = (IGasHandler) tileEntity;
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity tile = new BlockVec3(tileEntity).getTileEntityOnSide(tileEntity.getWorldObj(), direction);
if (gasHandler.canReceiveGas(direction, (Gas) EnergyConfigHandler.gasOxygen) && this.getTransmitters().contains(tile))
{
int oxygenToSend = (int) Math.floor(totalOxygen / this.oxygenTiles.size());