Nice city you got here, New York Assemblyman Charles Barron (D-Brooklyn) seemed to be saying ominously. Shame if something were to happen to it.

Last week, when Brooklyn DA Ken Thompson recommended a no-jail sentence for Peter Liang, the rookie cop convicted of manslaughter for killing Akai Gurley in a Housing Authority stairwell, Barron went off.

“Don’t make us bring Ferguson to New York City,” Barron thundered at Thompson — who, like Barron, is black. But who, unlike the assemblyman, seems to understand that proportionality and context must play a role in the administration of justice.

Under less fevered circumstances, Gurley’s death likely would’ve been seen as a tragic accident. Liang, on the job for less than a year, was descending a pitch-black stairwell in the crime-crippled Pink Houses in Brooklyn — his unholstered pistol in hand as NYPD protocols permit.

The gun went off — accidentally, according to trial testimony — and Gurley was struck fatally by the ricocheting bullet. The trial showed appalling negligence both on Liang’s part and in NYPD training routines.

But manslaughter? Thompson, whose own prosecutors say the shooting wasn’t intentional, seems to have reservations. His sentencing recommendation was brave, albeit sure to stir ugly reactions.

Barron didn’t disappoint.

The case — and its conjunction with the deaths of Eric Garner on Staten Island and Michael Brown in Ferguson, Mo. — offered Barron an opportunity to stir the pot. Both events sparked considerable violence — two separate full-blown riots in Missouri and the assassination of two cops in New York — and Barron seems to be encouraging something similar for Brooklyn:

“Some of our people are saying an eye for an eye, a tooth for a tooth, a life for a life. Am I saying we should be violent? I’m saying the [sentencing] will decide.”

Barron’s playing two games. There’s the obvious attempt to cow the Liang judge. But there also seems to be a more subtle effort to intimidate New York — one that Mayor Bill de Blasio, Police Commissioner Bill Bratton, Manhattan DA Cy Vance and even US Attorney General Loretta Lynch have at least implicitly endorsed.

And that’s the argument that racism, and not behavior, results in African-Americans being arrested, convicted and jailed in numbers disproportionate to other ethnic groups, especially whites.

It’s a specious argument; arrests and prosecutions of blacks are almost directly proportionate to the number and frequency of crimes committed against African-Americans — largely by other African-Americans.

This is true of murder and quality-of-life transgressions — low-level drug dealing and the full range of so-called broken-windows offenses that can make life in the inner city so vexatious. Innocent folks suffer, which seems to be of scant concern to de Blasio, Bratton, Vance, et al. — who are dumping quality-of-life policing in favor of letting offenders off the hook on race-equity grounds.

Lynch, as The Post reported Sunday, is threatening to bring the feds down on communities nationwide if they don’t scale back on arresting “disproportionate” numbers of African-Americans.

It’s a noxious policy — discriminating against victims and encouraging far more serious crime than mere quality-of-life offenses.

Consider the “Ferguson Effect” — the apparent reluctance of police to engage criminals in racially tense communities, which then leads to dramatic hikes in criminal carnage. It’s a controversial theory, and such spikes don’t happen everywhere — they haven’t yet in New York — but when they do, the effect can be appalling.

Arrests dropped 30 percent in Baltimore after the in-police-custody death of career criminal Freddie Gray — followed by a dramatic, across-the-board hike in crime of all sorts, according to a Johns Hopkins University study. The same is apparently true for St. Louis, Mo., after the Michael Brown riots.

And now the New York Times reports an eye-popping 84 percent murder hike in Chicago compared to a year ago, with the bloodshed linked to a scandal-driven relaxation of policing.

In all three cities, both victims and perpetrators have been overwhelmingly African-American.

This isn’t to suggest Baltimore and Chicago aren’t in need of profound police reform; they seem to be, especially Chicago. But it’s also clear that backing away from aggressive policing at every level can bring serious consequences.

This clearly doesn’t matter to a race-baiting boor like Charles Barron, but it should give honest policy-makers real pause. They’re playing with fire.