The United States Navy has come a long way, from its first wooden frigates to today’s nuclear carriers. But in all that time, one thing remained almost as fixed as the North Star: A skipper’s power to throw troublesome sailors in the brig with nothing to eat but bread and water.

Though it sounds like something from an old pirate movie, the antique penalty is not only still on the Navy’s books, it is still actually imposed, despite a century of abolition efforts.

On New Year’s Day, it will finally go by the boards.

A sweeping update of the Uniform Code of Military Justice, passed by Congress in 2016, will take effect on Jan. 1, bringing dozens of changes that are intended to make the system fairer and more efficient. Most are the kind of procedural tweaks that concern lawyers, not sailors. But the bread-and-water part will be felt on all decks.

Commanders throughout the armed services will still have the authority to punish minor misconduct in various ways without a trial. But the new law deletes the regulation that authorized ship commanders to confine low-ranking sailors on “diminished rations” — bread and water — for up to three days at a time.