Your dream isn't real. It's just your wonderful, miraculous, extremely complex brain doing dreamy things in your sleep.
Changing your behaviour in the real world in response to a dream should only be done if it's something positive.
What you should do is next time you see him, if he's with your friend, say something like "Ah this is Fred, your boyfriend. Pleased to meet you." If he's alone or with other people say "Hi! You're Jane's friend..."
In other words you should look to include him as a platonic friend in your social circle.
Because that's what normal human beings with social skills do. Instead of all this socially awkward stuff of looking at each other and not saying anything.
If you want a boyfriend for yourself, there's an abundance of men out there. Go get one for yourself. Just be aware that if you're dating teen boys, you should keep your expectations realistic in terms of how mature the boy will be. And how much drama they will introduce into your life as a result.
...And you should aim to be on good speaking terms with everyone in every class you go to. Some you'll gel with more than others. That's fine. Just spend more time with the people you like best.