§ An amoraic dispute was stated with regard to one who entered another’s field and planted trees in it without the permission of the owner of the field. Since the owner of the field profits from the planter’s actions, he is required to pay him. Rav says: The court appraises both the expenses for the one who planted the trees and the value of the improvements and the planter is at a disadvantage, i.e., the owner of the field pays the lesser of the two amounts. And Shmuel says: The court estimates how much a person would be willing to give for someone to plant trees in this field, and that is how much the owner of the field must pay.
The following rules apply if a squatter enters a field belonging to a colleague without permission and plants trees there. If the field was one appropriate for trees to be planted, we evaluate how much a person would be willing to pay for trees to be planted in this field, and he collects this amount from the owner of the field. If this field is not suitable for planting, the squatter's improvement of the field should be evaluated, and he is judged at a disadvantage.
...