Housing in San Francisco was at a premium, and abandoned ships whose crews had headed for the mines were often converted to temporary lodging. In the goldfields themselves, living conditions were primitive, though the mild climate proved attractive. Supplies were expensive and food poor, typical diets consisting mostly of pork, beans, and whiskey. These highly male, transient communities with no established institutions were prone to high levels of violence, drunkenness, profanity, and greed-driven behavior. Without courts or law officers in the mining communities to enforce claims and justice, miners developed their ad hoc legal system, based on the "mining codes" used in other mining communities abroad. Each camp had its own rules and often handed out justice by popular vote, sometimes acting fairly and at times exercising vigilantes; with Indians (Native Americans), Mexicans, and Chinese generally receiving the harshest sentences.