public void func_35004_a(StructureComponent p_35004_1_, List p_35004_2_, Random p_35004_3_) { int i = func_35012_c(); switch (field_35025_h) { case 2: // '\002' StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, field_35024_g.field_35751_b, field_35024_g.field_35752_c - 1, 2, i); break; case 0: // '\0' StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, field_35024_g.field_35751_b, field_35024_g.field_35748_f + 1, 0, i); break; case 1: // '\001' StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a - 1, field_35024_g.field_35751_b, field_35024_g.field_35752_c, 1, i); break; case 3: // '\003' StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d + 1, field_35024_g.field_35751_b, field_35024_g.field_35752_c, 3, i); break; } }
public void buildComponent(StructureComponent structurecomponent, List list, Random random) { int i = getComponentType(); switch (coordBaseMode) { case 2: // '\002' StructureMineshaftPieces.getNextComponent( structurecomponent, list, random, boundingBox.minX, boundingBox.minY, boundingBox.minZ - 1, 2, i); break; case 0: // '\0' StructureMineshaftPieces.getNextComponent( structurecomponent, list, random, boundingBox.minX, boundingBox.minY, boundingBox.maxZ + 1, 0, i); break; case 1: // '\001' StructureMineshaftPieces.getNextComponent( structurecomponent, list, random, boundingBox.minX - 1, boundingBox.minY, boundingBox.minZ, 1, i); break; case 3: // '\003' StructureMineshaftPieces.getNextComponent( structurecomponent, list, random, boundingBox.maxX + 1, boundingBox.minY, boundingBox.minZ, 3, i); break; } }
/** * 'Initiates construction of the Structure Component picked, at the current Location of * StructGen' */ public void buildComponent( StructureComponent par1StructureComponent, List par2List, Random par3Random) { int i = getComponentType(); int j = par3Random.nextInt(4); switch (coordBaseMode) { case 2: if (j <= 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ - 1, coordBaseMode, i); } else if (j == 2) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX - 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ, 1, i); } else { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX + 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ, 3, i); } break; case 0: if (j <= 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.maxZ + 1, coordBaseMode, i); } else if (j == 2) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX - 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.maxZ - 3, 1, i); } else { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX + 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.maxZ - 3, 3, i); } break; case 1: if (j <= 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX - 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ, coordBaseMode, i); } else if (j == 2) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ - 1, 2, i); } else { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.maxZ + 1, 0, i); } break; case 3: if (j <= 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX + 1, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ, coordBaseMode, i); } else if (j == 2) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX - 3, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.minZ - 1, 2, i); } else { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX - 3, (boundingBox.minY - 1) + par3Random.nextInt(3), boundingBox.maxZ + 1, 0, i); } break; } if (i < 8) { if (coordBaseMode == 2 || coordBaseMode == 0) { for (int k = boundingBox.minZ + 3; k + 3 <= boundingBox.maxZ; k += 5) { int i1 = par3Random.nextInt(5); if (i1 == 0) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.minX - 1, boundingBox.minY, k, 1, i + 1); } else if (i1 == 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, boundingBox.maxX + 1, boundingBox.minY, k, 3, i + 1); } } } else { for (int l = boundingBox.minX + 3; l + 3 <= boundingBox.maxX; l += 5) { int j1 = par3Random.nextInt(5); if (j1 == 0) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, l, boundingBox.minY, boundingBox.minZ - 1, 2, i + 1); continue; } if (j1 == 1) { StructureMineshaftPieces.getNextComponent( par1StructureComponent, par2List, par3Random, l, boundingBox.minY, boundingBox.maxZ + 1, 0, i + 1); } } } } }
/** * 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it * closes Mineshafts at the end, it adds Fences...' */ public boolean addComponentParts( World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { if (isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { return false; } int i = sectionCount * 5 - 1; fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 2, 1, i, 0, 0, false); randomlyFillWithBlocks( par1World, par3StructureBoundingBox, par2Random, 0.8F, 0, 2, 0, 2, 2, i, 0, 0, false); if (hasSpiders) { randomlyFillWithBlocks( par1World, par3StructureBoundingBox, par2Random, 0.6F, 0, 0, 0, 2, 1, i, Block.web.blockID, 0, false); } for (int j = 0; j < sectionCount; j++) { int i1 = 2 + j * 5; fillWithBlocks( par1World, par3StructureBoundingBox, 0, 0, i1, 0, 1, i1, Block.fence.blockID, 0, false); fillWithBlocks( par1World, par3StructureBoundingBox, 2, 0, i1, 2, 1, i1, Block.fence.blockID, 0, false); if (par2Random.nextInt(4) != 0) { fillWithBlocks( par1World, par3StructureBoundingBox, 0, 2, i1, 2, 2, i1, Block.planks.blockID, 0, false); } else { fillWithBlocks( par1World, par3StructureBoundingBox, 0, 2, i1, 0, 2, i1, Block.planks.blockID, 0, false); fillWithBlocks( par1World, par3StructureBoundingBox, 2, 2, i1, 2, 2, i1, Block.planks.blockID, 0, false); } randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, i1 - 1, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, i1 - 1, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, i1 + 1, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, i1 + 1, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, i1 - 2, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, i1 - 2, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, i1 + 2, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, i1 + 2, Block.web.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, i1 - 1, Block.torchWood.blockID, 0); randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, i1 + 1, Block.torchWood.blockID, 0); if (par2Random.nextInt(100) == 0) { createTreasureChestAtCurrentPosition( par1World, par3StructureBoundingBox, par2Random, 2, 0, i1 - 1, StructureMineshaftPieces.getTreasurePieces(), 3 + par2Random.nextInt(4)); } if (par2Random.nextInt(100) == 0) { createTreasureChestAtCurrentPosition( par1World, par3StructureBoundingBox, par2Random, 0, 0, i1 + 1, StructureMineshaftPieces.getTreasurePieces(), 3 + par2Random.nextInt(4)); } if (!hasSpiders || spawnerPlaced) { continue; } int l1 = getYWithOffset(0); int j2 = (i1 - 1) + par2Random.nextInt(3); int k2 = getXWithOffset(1, j2); j2 = getZWithOffset(1, j2); if (!par3StructureBoundingBox.isVecInside(k2, l1, j2)) { continue; } spawnerPlaced = true; par1World.setBlockWithNotify(k2, l1, j2, Block.mobSpawner.blockID); TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) par1World.getBlockTileEntity(k2, l1, j2); if (tileentitymobspawner != null) { tileentitymobspawner.setMobID("CaveSpider"); } } for (int k = 0; k <= 2; k++) { for (int j1 = 0; j1 <= i; j1++) { int i2 = getBlockIdAtCurrentPosition(par1World, k, -1, j1, par3StructureBoundingBox); if (i2 == 0) { placeBlockAtCurrentPosition( par1World, Block.planks.blockID, 0, k, -1, j1, par3StructureBoundingBox); } } } if (hasRails) { for (int l = 0; l <= i; l++) { int k1 = getBlockIdAtCurrentPosition(par1World, 1, -1, l, par3StructureBoundingBox); if (k1 > 0 && Block.opaqueCubeLookup[k1]) { randomlyPlaceBlock( par1World, par3StructureBoundingBox, par2Random, 0.7F, 1, 0, l, Block.rail.blockID, getMetadataWithOffset(Block.rail.blockID, 0)); } } } return true; }
public void func_35004_a(StructureComponent p_35004_1_, List p_35004_2_, Random p_35004_3_) { int i = func_35012_c(); int j = p_35004_3_.nextInt(4); switch (field_35025_h) { case 2: // '\002' if (j <= 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c - 1, field_35025_h, i); } else if (j == 2) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a - 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c, 1, i); } else { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d + 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c, 3, i); } break; case 0: // '\0' if (j <= 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35748_f + 1, field_35025_h, i); } else if (j == 2) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a - 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35748_f - 3, 1, i); } else { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d + 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35748_f - 3, 3, i); } break; case 1: // '\001' if (j <= 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a - 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c, field_35025_h, i); } else if (j == 2) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c - 1, 2, i); } else { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35748_f + 1, 0, i); } break; case 3: // '\003' if (j <= 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d + 1, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c, field_35025_h, i); } else if (j == 2) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d - 3, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35752_c - 1, 2, i); } else { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d - 3, (field_35024_g.field_35751_b - 1) + p_35004_3_.nextInt(3), field_35024_g.field_35748_f + 1, 0, i); } break; } if (i < 8) { if (field_35025_h == 2 || field_35025_h == 0) { for (int k = field_35024_g.field_35752_c + 3; k + 3 <= field_35024_g.field_35748_f; k += 5) { int i1 = p_35004_3_.nextInt(5); if (i1 == 0) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35753_a - 1, field_35024_g.field_35751_b, k, 1, i + 1); } else if (i1 == 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, field_35024_g.field_35749_d + 1, field_35024_g.field_35751_b, k, 3, i + 1); } } } else { for (int l = field_35024_g.field_35753_a + 3; l + 3 <= field_35024_g.field_35749_d; l += 5) { int j1 = p_35004_3_.nextInt(5); if (j1 == 0) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, l, field_35024_g.field_35751_b, field_35024_g.field_35752_c - 1, 2, i + 1); continue; } if (j1 == 1) { StructureMineshaftPieces.func_35585_a( p_35004_1_, p_35004_2_, p_35004_3_, l, field_35024_g.field_35751_b, field_35024_g.field_35748_f + 1, 0, i + 1); } } } } }
public boolean func_35023_a( World p_35023_1_, Random p_35023_2_, StructureBoundingBox p_35023_3_) { if (func_35013_a(p_35023_1_, p_35023_3_)) { return false; } int i = field_35067_d * 5 - 1; func_35011_a(p_35023_1_, p_35023_3_, 0, 0, 0, 2, 1, i, 0, 0, false); func_35010_a(p_35023_1_, p_35023_3_, p_35023_2_, 0.8F, 0, 2, 0, 2, 2, i, 0, 0, false); if (field_35068_b) { func_35010_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.6F, 0, 0, 0, 2, 1, i, Block.field_9258_W.field_376_bc, 0, false); } for (int j = 0; j < field_35067_d; j++) { int i1 = 2 + j * 5; func_35011_a( p_35023_1_, p_35023_3_, 0, 0, i1, 0, 1, i1, Block.field_4057_ba.field_376_bc, 0, false); func_35011_a( p_35023_1_, p_35023_3_, 2, 0, i1, 2, 1, i1, Block.field_4057_ba.field_376_bc, 0, false); if (p_35023_2_.nextInt(4) != 0) { func_35011_a( p_35023_1_, p_35023_3_, 0, 2, i1, 2, 2, i1, Block.field_334_y.field_376_bc, 0, false); } else { func_35011_a( p_35023_1_, p_35023_3_, 0, 2, i1, 0, 2, i1, Block.field_334_y.field_376_bc, 0, false); func_35011_a( p_35023_1_, p_35023_3_, 2, 2, i1, 2, 2, i1, Block.field_334_y.field_376_bc, 0, false); } func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.1F, 0, 2, i1 - 1, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.1F, 2, 2, i1 - 1, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.1F, 0, 2, i1 + 1, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.1F, 2, 2, i1 + 1, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 0, 2, i1 - 2, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 2, 2, i1 - 2, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 0, 2, i1 + 2, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 2, 2, i1 + 2, Block.field_9258_W.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 1, 2, i1 - 1, Block.field_404_ar.field_376_bc, 0); func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.05F, 1, 2, i1 + 1, Block.field_404_ar.field_376_bc, 0); if (p_35023_2_.nextInt(100) == 0) { func_35003_a( p_35023_1_, p_35023_3_, p_35023_2_, 2, 0, i1 - 1, StructureMineshaftPieces.func_35588_a(), 3 + p_35023_2_.nextInt(4)); } if (p_35023_2_.nextInt(100) == 0) { func_35003_a( p_35023_1_, p_35023_3_, p_35023_2_, 0, 0, i1 + 1, StructureMineshaftPieces.func_35588_a(), 3 + p_35023_2_.nextInt(4)); } if (!field_35068_b || field_35069_c) { continue; } int l1 = func_35008_a(0); int j2 = (i1 - 1) + p_35023_2_.nextInt(3); int k2 = func_35017_a(1, j2); j2 = func_35006_b(1, j2); if (!p_35023_3_.func_35742_b(k2, l1, j2)) { continue; } field_35069_c = true; p_35023_1_.func_690_d(k2, l1, j2, Block.field_400_at.field_376_bc); TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) p_35023_1_.func_603_b(k2, l1, j2); if (tileentitymobspawner != null) { tileentitymobspawner.func_21098_a("CaveSpider"); } } for (int k = 0; k <= 2; k++) { for (int j1 = 0; j1 <= i; j1++) { int i2 = func_35007_a(p_35023_1_, k, -1, j1, p_35023_3_); if (i2 == 0) { func_35018_a(p_35023_1_, Block.field_334_y.field_376_bc, 0, k, -1, j1, p_35023_3_); } } } if (field_35070_a) { for (int l = 0; l <= i; l++) { int k1 = func_35007_a(p_35023_1_, 1, -1, l, p_35023_3_); if (k1 > 0 && Block.field_343_p[k1]) { func_35014_a( p_35023_1_, p_35023_3_, p_35023_2_, 0.7F, 1, 0, l, Block.field_440_aH.field_376_bc, func_35009_c(Block.field_440_aH.field_376_bc, 0)); } } } return true; }