We found a way to escape the exception (by adding a conditional around the logger), we can then get into the world, and when using the /locate our structures are available (auto-completion), but that's all : it seems that the structures aren't even generated now !
Here is the link for the screenshot of the result of /locate : https://drive.google.com/file/d/1P9bso9rTcZAngd3oeVI0Apfw8sCREGI2/view?usp=sharing
Here is our method for structure generation : (the NETHER biome test is only for Nether generation, it doesn't affect the overall generation)
@Override // GeneratePieces
public void func_230364_a_(DynamicRegistries dynamicRegistryManager, ChunkGenerator chunkGenerator,
TemplateManager templateManagerIn, int chunkX, int chunkZ, Biome biomeIn,
NoFeatureConfig config) {
int x = (chunkX << 4) + 8;
int z = (chunkZ << 4) + 8;
BlockPos blockpos;
if (biomeIn.getCategory().toString().equals("NETHER")) {
int y = getLowestLand(chunkGenerator, x, z).getY();
blockpos = new BlockPos(x, structureHigh() - y + 1, z);
} else {
blockpos = new BlockPos(x, structureHigh(), z);
}
try {
JigsawManager.func_242837_a(dynamicRegistryManager,
new VillageConfig(() -> dynamicRegistryManager.getRegistry(Registry.JIGSAW_POOL_KEY)
.getOrDefault(new ResourceLocation(SchematicsInWorld.MOD_ID,
name() + "/" + name() + "_pool")),
10), AbstractVillagePiece::new, chunkGenerator, templateManagerIn,
blockpos, this.components, this.rand, false, true);
} catch (NullPointerException e) {
// First launch after adding structures
}
this.components.forEach(piece -> piece.offset(0, 1, 0));
this.components.forEach(piece -> piece.getBoundingBox().minY -= 1);
this.recalculateStructureSize();
if (this.components.size() > 0) {
LogManager.getLogger().log(Level.DEBUG, name() +" at " +
this.components.get(0).getBoundingBox().minX + " " +
this.components.get(0).getBoundingBox().minY + " " +
this.components.get(0).getBoundingBox().minZ);
}
}