This problem is due to early returns in two places. I’m using the official mapping for 1.21.2.
First, in ChunkGenerator#locateStructure, and second, in ChunkGenerator#locateRandomSpreadStructure. RandomSpreadStructurePlacement#getStartChunk performs a floor division, which causes searches to be aligned to a square grid with side length equal to the spacing. However, a structure located in a closer block on that grid doesn’t mean it is actually closer in distance — this leads to the first early return in locateStructure. In locateRandomSpreadStructure, it simply returns the first block on the grid that contains the desired structure, but it should actually search the entire edge.
This problem is due to early returns in two places. I’m using the official mapping for 1.21.2.
First, in ChunkGenerator#locateStructure, and second, in ChunkGenerator#locateRandomSpreadStructure. RandomSpreadStructurePlacement#getStartChunk performs a floor division, which causes searches to be aligned to a square grid with side length equal to the spacing. However, a structure located in a closer block on that grid doesn’t mean it is actually closer in distance — this leads to the first early return in locateStructure. In locateRandomSpreadStructure, it simply returns the first block on the grid that contains the desired structure, but it should actually search the entire edge.