Warships cruising around at night with no lights on as bait just waiting for stupid pirates to attack. That would make pirating a more hazardous pastime and perhaps persuade the pirates to go into other, safer lines of work such as drug trafficking.
But they would still have to be pretty stupid. They can afford a boat load of automatic weapons but they can't come up with night vision goggles? Even 1st gen should be able to destinguish between a warship and a cargo ship.