The Magic's Mario Hezonja makes a move to the basket...

The Magic's Mario Hezonja makes a move to the basket against Nets' DeMarre Carroll, left, during the first half on March 28 in Orlando, Fla. Credit: AP / John Raoux

The Knicks were never in the running for LeBron James, but they did land a new small forward in free agency.

Former Orlando Magic forward Mario Hezonja, 23, reached an agreement Sunday on a one-year, $6.5-million deal with the Knicks, league sources said. The Knicks are giving up part of their $8.6-million midlevel exception to sign him.

The Knicks also agreed to terms with Luke Kornet on the first full day of the free-agent negotiation period. They’re bringing back the second-year stretch big man on a one-year, $1.6-million deal, a league source said.

These deals cannot be signed or announced until the free-agency moratorium ends Friday.

Keeping true to their plan, the Knicks are giving out only one-year contracts so they will have maximum salary-cap room next summer for a star-studded free-agent class.

Hezonja was an intriguing signing. The Knicks needed additional scoring with Kristaps Porzingis out indefinitely as he recovers from a torn left ACL, and Hezonja should get a chance to play. Although they drafted Kevin Knox, he’s only 18 and will need time to grow.

Taken fifth in the 2015 NBA Draft one pick after Porzingis, Hezonja is athletic and can spread the floor with his shooting. Knicks general manager Scott Perry was part of the Orlando front office when the Magic selected Hezonja, so they are reuniting with the Knicks.

Hezonja has been a disappointment but came on at the end of last season and averaged 9.6 points and 3.7 rebounds.

The Croatian received interest from multiple teams after the Magic declined his $5.2-million fourth-year option and made him a free agent. The Trail Blazers, Kings and Grizzlies reportedly also pursued him, but he chose the Knicks and the opportunity to play for David Fizdale.

Hezonja called being a Knick “a dream come true” on social media Sunday night. He posted a picture of himself in a Knicks sweatshirt and tweeted, “Start spreading the news . . . I want to be a part of it, New York, New York! Very excited to be joining the Knicks and play for coach Fizdale! A dream come true!!”

Hezonja’s decision to pass on a playoff team in Portland to play for the Knicks could be a sign that the perception of the franchise is changing. The Knicks have been trying to rebuild as a team and as an organization under Mills and Perry. They’re hoping it pays off next summer in free agency.

Once Hezonja signs, the Knicks will have three of the top seven picks from the 2015 NBA Draft. They acquired No. 7 choice Emmanuel Mudiay from Denver last season.

This move would seem to signal the end of Michael Beasley’s brief tenure as a Knick. Beasley was on their radar as insurance if they didn’t get Hezonja, who was a top target for the Knicks all along.

The Knicks also reached out to some power forwards, including Anthony Tolliver and Amir Johnson, sources said. But money and roster spots are limited after these two agreements.

They have about $2.1 million remaining on the midlevel exception and the $3.4-million biannual exception to spend in free agency. Hezonja and Kornet give the Knicks 14 players under contract. That number will grow to 16 when Knox and second-round pick Mitchell Robinson sign. Robinson is expected to get a portion of the remaining midlevel.

Trey Burke and Troy Williams have only partially guaranteed deals, though Burke is expected to stick after his strong finish to last season.

The Knicks are looking to trade Courtney Lee and Joakim Noah. It’s more likely that Noah will be waived and have his contract stretched later in the summer, which would open another roster spot.

Kornet was signed to a two-way contract last season after he was undrafted out of Vanderbilt. He played much of the season in the G League for the Westchester Knicks.

With Kornet in the fold, it’s unlikely that Kyle O’Quinn, who opted out of his contract, will return to the Knicks. The 76ers are among the teams that reportedly have shown interest in O’Quinn.

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME