Parliament has passed a bill that protects building sub-contractors from losing money when a business goes bust.
It says contracting companies must hold in trust money they retain to put right any faults or repairs to the work carried out by the sub-contractors.
That money could previously be used as working capital, and was at risk if a business failed.
"This new law will benefit tens of thousands of small sub-contracting businesses like plumbers, electricians, plasterers, tiles and painters," Building and Housing Minister Nick Smith said.
"It means the people who do the bulk of the physical work on building projects get properly paid for their labour."
Dr Smith says the problem was highlighted when Mainzeal collapsed in 2013.
"About $18 million of sub-contractors retention money was lost," he said.
"This [new law] will drive better business practices."