Template template = manager.getTemplate(server, WeightedUtil.getRandomStructure(rand, variants, "pyramid_torrid_blazing_"));
ChunkPos chunkPos = new ChunkPos(pos);
StructureBoundingBox structureBB = new StructureBoundingBox(chunkPos.getXStart(), 0, chunkPos.getZStart(), chunkPos.getXEnd(), 256, chunkPos.getZEnd());
PlacementSettings settings = new PlacementSettings().setMirror(mirror).setRotation(rotation).setBoundingBox(structureBB).setRandom(rand);
BlockPos structureSize = Template.transformedBlockPos(settings.copy(), template.getSize());
<BUG>BlockPos spawnPos = WorldGenUtil.getSuitableGroundPos(world, Template.getZeroPositionWithTransform(new BlockPos(chunkPos.getXStart() + 8 - structureSize.getX() / 2, 96, chunkPos.getZStart() + 8 - structureSize.getZ() / 2), mirror, rotation, structureSize.getX(), structureSize.getZ()), structureSize.getX(), structureSize.getZ(), 0.8F);
if(spawnPos != BlockPos.ORIGIN)</BUG>
{
template.addBlocksToWorld(world, spawnPos, settings.copy(), 20);
WorldGenUtil.setChestContents(world, rand, spawnPos, structureSize, LootTableList.CHESTS_NETHER_BRIDGE);

Template template = manager.getTemplate(server, WeightedUtil.getRandomStructure(rand, variants, "pyramid_torrid_blazing_"));
ChunkPos chunkPos = new ChunkPos(pos);
StructureBoundingBox structureBB = new StructureBoundingBox(chunkPos.getXStart(), 0, chunkPos.getZStart(), chunkPos.getXEnd(), 256, chunkPos.getZEnd());
PlacementSettings settings = new PlacementSettings().setMirror(mirror).setRotation(rotation).setBoundingBox(structureBB).setRandom(rand);
BlockPos structureSize = Template.transformedBlockPos(settings.copy(), template.getSize());
BlockPos newPos = new BlockPos(chunkPos.getXStart() + 8 - structureSize.getX() / 2, 96, chunkPos.getZStart() + 8 - structureSize.getZ() / 2);
BlockPos spawnPos = WorldGenUtil.getSuitableGroundPos(world, newPos, allowedBlocks, structureSize.getX(), structureSize.getZ(), 0.8F);
if(spawnPos != BlockPos.ORIGIN)
{
template.addBlocksToWorld(world, spawnPos, settings.copy(), 20);
WorldGenUtil.setChestContents(world, rand, spawnPos, structureSize, LootTableList.CHESTS_NETHER_BRIDGE);
