Very minor point (not worth changing), but you can use isEmpty() here. :P

More generally, the assumption there can only be one block per prefab is incorrect - since the prefab just supplies functionality to the block, multiple blocks could use the same prefab to get the same functionality. So I would reconsider trying to find blocks by prefabs - this may tie into having stand-alone recipe prefabs.