/// <summary> /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at /// the end, it adds Fences...' /// </summary> public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { if (AverageGroundLevel < 0) { AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox); if (AverageGroundLevel < 0) { return(true); } BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 4) - 1, 0); } FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 12, 4, 8, 0, 0, false); FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 1, 8, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 10, 0, 1, 11, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 12, 0, 0, 12, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 11, 0, 0, Block.Wood.BlockID, Block.Wood.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 11, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.WaterMoving.BlockID, Block.WaterMoving.BlockID, false); FillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 1, 9, 0, 7, Block.WaterMoving.BlockID, Block.WaterMoving.BlockID, false); for (int i = 1; i <= 7; i++) { PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 1, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 2, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 4, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 5, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 7, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 8, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 10, 1, i, par3StructureBoundingBox); PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 11, 1, i, par3StructureBoundingBox); } for (int j = 0; j < 9; j++) { for (int k = 0; k < 13; k++) { ClearCurrentPositionBlocksUpwards(par1World, k, 4, j, par3StructureBoundingBox); FillCurrentPositionBlocksDownwards(par1World, Block.Dirt.BlockID, 0, k, -1, j, par3StructureBoundingBox); } } return(true); }
public static StructureBoundingBox Func_35087_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6) { for (int i = 7 * MathHelper2.GetRandomIntegerInRange(par2Random, 3, 5); i >= 7; i -= 7) { StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 3, i, par6); if (StructureComponent.FindIntersecting(par1List, structureboundingbox) == null) { return(structureboundingbox); } } return(null); }
public static List <StructureVillagePieceWeight> GetStructureVillageWeightedPieceList(Random par0Random, int par1) { List <StructureVillagePieceWeight> arraylist = new List <StructureVillagePieceWeight>(); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageHouse4_Garden), 4, MathHelper2.GetRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageChurch), 20, MathHelper2.GetRandomIntegerInRange(par0Random, 0 + par1, 1 + par1))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageHouse1), 20, MathHelper2.GetRandomIntegerInRange(par0Random, 0 + par1, 2 + par1))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageWoodHut), 3, MathHelper2.GetRandomIntegerInRange(par0Random, 2 + par1, 5 + par1 * 3))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageHall), 15, MathHelper2.GetRandomIntegerInRange(par0Random, 0 + par1, 2 + par1))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageField), 3, MathHelper2.GetRandomIntegerInRange(par0Random, 1 + par1, 4 + par1))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageField2), 3, MathHelper2.GetRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageHouse2), 15, MathHelper2.GetRandomIntegerInRange(par0Random, 0, 1 + par1))); arraylist.Add(new StructureVillagePieceWeight(typeof(net.minecraft.src.ComponentVillageHouse3), 8, MathHelper2.GetRandomIntegerInRange(par0Random, 0 + par1, 3 + par1 * 2))); /* * IEnumerator<StructureVillagePieceWeight> iterator = arraylist.GetEnumerator(); * * do * { * if (!iterator.MoveNext()) * { * break; * } * * if (iterator.Current.VillagePiecesLimit == 0) * { * iterator.Remove(); * } * } * while (true); */ return(arraylist); }