Offer to exchange your hat for the codpiece.

You offer your hat. The codsmith inspects its worth as potential material for a new cod piece. It shows promise, but it simply is not worth the same as the Hull of the Flagship. He refuses.