Cupboard range

Can anyone please help me to find the way to limit the range of cupboards distanse so players could not build unlimited entities with one cupboard?

With the way the cupboard works now all those entities would have to be connected to the foundation the cupboard is on unlike the original concept where it would protect anything within a specified range. You are still unable to place another cupboard too close to another cupboard