SAN FRANCISCO >> If Mac McClung’s dunk involving a hoverboard looked a tad familiar on Saturday night at Chase Center, that was intentional.

McClung looked to the South Bay’s greatest dunker for inspiration as he prepared to complete the first three-peat in NBA Slam Dunk Contest history.

Nine years earlier, Aaron Gordon had donned that same blue Orlando Magic jersey and put on a spectacular performance in the dunk contest.

One of the Archbishop Mitty product’s jams involved grabbing the ball from a person balancing on a spinning hoverboard.

McClung, who has played the majority of his career in the NBA G-League since leaving Texas Tech, replicated the move with his right hand, added a simultaneous dunk by slamming another ball with his left hand, and earned a perfect 50.

And unlike Gordon, who controversially came in second to Zach Lavine, McClung ended the night as the winner for the third year in a row.

“I just wanted to show my respect to (Gordon),” McClung said. “I was using one of his ideas, and that contest, I think there were two winners that night. So yeah, it was just a shout-out to him and showing appreciation for him.”

McClung’s homage to Gordon wasn’t the only time the past was referenced in San Francisco.

The NBA did its best to recreate the 2000 dunk contest in Oakland.

Jason Richardson and Tracy McGrady were judges, famous spectators Shaquille O’Neal and Kevin Garnett were in the building, and winner Vince Carter sat courtside. Kenny Smith repeated his famous refrain “It’s over” into the microphone.

The only way it could have been more 2000 was if Carter had torn off his suit and tie to reveal a purple Raptors jersey before dunking from the free-throw line.

Even though the event on Saturday took place across the Bay in San Francisco, that legendary night from a quarter century ago set an almost unreachably lofty standard for the Bay Area.

But it was well within reach for high flier McClung, as he left his iconic onlookers slack-jawed and the paying customers in a frenzy during a dominant dunk contest performance that secured his third consecutive title.

“It feels like a blur,” McClung said. “It’s something I just love doing.”

Spurs rookie guard Stephon Castle was phenomenal, hitting 49.6 and 50.0 on his final two dunks.

But he wasn’t perfect.

McClung was.

The Virginia native who played on the Warriors’ 2022 Summer League team scored a perfect 50 on all four of his dunks.

Arguably his best was the first, in which he wheeled out a car Blake Griffin-style.

But instead of just barely clearing the lowest part of the hood, McClung grabbed the ball from above the sunroof and crammed in a reverse dunk before crashing to the court.

“I was thinking, ‘Please go in, ball’ and then on the car I’m like ‘please don’t land on the car,’ ” McClung said. “We’ve been practicing these dunks for eight or nine months.”

It was a thrilling conclusion to a night that began as something of a dud.

Castle got things going with a slick 180 windmill after a short runup from the right wing, nailing the jam on his first attempt.

The fans were then subjected to watching the Bulls’ Matas Buzelis and the Bucks’ Andre Jackson Jr. miss five of six dunk attempts, with Buzelis blowing each dunk after attempting the same between-the-legs jam. Jackson salvaged his turn by settling for a pedestrian two-handed scoop.

McClung’s car-hopping dunk completely re-energized the crowd.

McClung and Castle traded aerial masterpieces, but Castle was deducted 0.4 points for taking several attempts to complete a twisting between the legs dunk after grabbing the ball falling through the hoop.

That tiny margin was enough to separate McClung from Castle.

“Yeah, I mean, his dunks are crazy,” Castle said. “I would give all his dunks 50, too, but I feel like he earned it and he did a great job.”

Will McClung go for four straight? He’s not ruling it out.

“I was thinking of hanging it up after this one, but I never want to say never,” McClung said.