Sam Worthington has just been smacked with a restraining order -- with a judge BARRING the "Avatar" actor from having any contact with the pap he allegedly attacked in NYC this weekend.
Worthington just appeared in an NYC courtroom to face charges stemming from the February 23 incident with photo Sheng Li ... when Sam allegedly punched the guy following an altercation with his GF Lara Bingle.
During the hearing, Sam was charged with two 2 counts of 3rd degree assault, 1 count of attempted assault, 1 count of harassment -- and faces a maximum of one year in jail if convicted.
But the most shocking part of the hearing -- the restraining order ... which specifically orders Sam to not contact Li in person, on the phone or through social media.
Worthington is due back in court on May 8th.