A dockworker has pleaded guilty to stealing “metal and hull valves” made for the Royal Navy flagship.