@@ -0,0 +1,2355 @@
+package net.darkmorford.btweagles.villager;%0A%0Aimport net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.init.Blocks;%0Aimport net.minecraft.util.EnumFacing;%0Aimport net.minecraft.world.World;%0Aimport net.minecraft.world.gen.structure.StructureBoundingBox;%0Aimport net.minecraft.world.gen.structure.StructureComponent;%0Aimport net.minecraft.world.gen.structure.StructureVillagePieces;%0Aimport net.minecraftforge.fml.common.registry.VillagerRegistry;%0A%0Aimport java.util.List;%0Aimport java.util.Random;%0A%0Apublic class VillagerStructures%0A%7B%0A%09public static class Cave extends StructureVillagePieces.Village%0A%09%7B%0A%09%09public Cave()%0A%09%09%7B%0A%09%09%7D%0A%0A%09%09public Cave(StructureVillagePieces.Start start, int type, Random rand, StructureBoundingBox box, EnumFacing facing)%0A%09%09%7B%0A%09%09%09super(start, type);%0A%09%09%09this.setCoordBaseMode(facing);%0A%09%09%09this.boundingBox = box;%0A%09%09%7D%0A%0A%09%09public static Cave createPiece(StructureVillagePieces.Start start, List%3CStructureComponent%3E components, Random rand, int x, int y, int z, EnumFacing facing, int type)%0A%09%09%7B%0A%09%09%09StructureBoundingBox box = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 9, 6, 10, facing);%0A%09%09%09return canVillageGoDeeper(box) && StructureComponent.findIntersecting(components, box) == null ? new Cave(start, type, rand, box, facing) : null;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)%0A%09%09%7B%0A%09%09%09if (this.averageGroundLvl %3C 0)%0A%09%09%09%7B%0A%09%09%09%09this.averageGroundLvl = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn);%0A%0A%09%09%09%09if (this.averageGroundLvl %3C 0)%0A%09%09%09%09%7B%0A%09%09%09%09%09return true;%0A%09%09%09%09%7D%0A%0A%09%09%09%09this.boundingBox.offset(0, this.averageGroundLvl - this.boundingBox.maxY + 5, 0);%0A%09%09%09%7D%0A%0A%09%09%09IBlockState cobble = Blocks.COBBLESTONE.getDefaultState();%0A%0A%09%09%09this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 9, 6, 10, cobble, Blocks.AIR.getDefaultState(), false);%0A%0A%09%09%09for (int x = 0; x %3C 9; ++x)%0A%09%09%09%7B%0A%09%09%09%09for (int z = 0; z %3C 10; ++z)%0A%09%09%09%09%7B%0A%09%09%09%09%09this.clearCurrentPositionBlocksUpwards(worldIn, x, 6, z, structureBoundingBoxIn);%0A%09%09%09%09%09this.replaceAirAndLiquidDownwards(worldIn, cobble, x, -1, z, structureBoundingBoxIn);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09return true;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09protected VillagerRegistry.VillagerProfession chooseForgeProfession(int count, VillagerRegistry.VillagerProfession prof)%0A%09%09%7B%0A%09%09%09return ModVillagers.professionKrog;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add a basic village structure.