public static StructureBoundingBox func_74992_a( List p_74992_0_, Random p_74992_1_, int p_74992_2_, int p_74992_3_, int p_74992_4_, int p_74992_5_) { boolean var6 = true; StructureBoundingBox var7 = StructureBoundingBox.func_78889_a( p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, 4, p_74992_5_); StructureComponent var8 = StructureComponent.func_74883_a(p_74992_0_, var7); if (var8 == null) { return null; } else { if (var8.func_74874_b().field_78895_b == var7.field_78895_b) { for (int var9 = 3; var9 >= 1; --var9) { var7 = StructureBoundingBox.func_78889_a( p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, var9 - 1, p_74992_5_); if (!var8.func_74874_b().func_78884_a(var7)) { return StructureBoundingBox.func_78889_a( p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, var9, p_74992_5_); } } } return null; } }
public ComponentStrongholdCorridor( int p_i2072_1_, Random p_i2072_2_, StructureBoundingBox p_i2072_3_, int p_i2072_4_) { super(p_i2072_1_); this.field_74885_f = p_i2072_4_; this.field_74887_e = p_i2072_3_; this.field_74993_a = p_i2072_4_ != 2 && p_i2072_4_ != 0 ? p_i2072_3_.func_78883_b() : p_i2072_3_.func_78880_d(); }
public StructureComponentSaturnVillagePathGen( StructureComponentSaturnVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { super(par1ComponentVillageStartPiece, par2); this.coordBaseMode = par5; this.boundingBox = par4StructureBoundingBox; this.averageGroundLevel = Math.max(par4StructureBoundingBox.getXSize(), par4StructureBoundingBox.getZSize()); }
protected boolean func_74869_a( World p_74869_1_, StructureBoundingBox p_74869_2_, Random p_74869_3_, int p_74869_4_, int p_74869_5_, int p_74869_6_, int p_74869_7_, WeightedRandomChestContent[] p_74869_8_, int p_74869_9_) { int var10 = this.func_74865_a(p_74869_4_, p_74869_6_); int var11 = this.func_74862_a(p_74869_5_); int var12 = this.func_74873_b(p_74869_4_, p_74869_6_); if (p_74869_2_.func_78890_b(var10, var11, var12) && p_74869_1_.func_72798_a(var10, var11, var12) != Block.field_71958_P.field_71990_ca) { p_74869_1_.func_72832_d( var10, var11, var12, Block.field_71958_P.field_71990_ca, this.func_74863_c(Block.field_71958_P.field_71990_ca, p_74869_7_), 2); TileEntityDispenser var13 = (TileEntityDispenser) p_74869_1_.func_72796_p(var10, var11, var12); if (var13 != null) { WeightedRandomChestContent.func_76294_a(p_74869_3_, p_74869_8_, var13, p_74869_9_); } return true; } else { return false; } }
protected void spawnVillagers( World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6) { if (this.villagersSpawned < par6) { for (int var7 = this.villagersSpawned; var7 < par6; ++var7) { int var8 = this.getXWithOffset(par3 + var7, par5); final int var9 = this.getYWithOffset(par4); int var10 = this.getZWithOffset(par3 + var7, par5); var8 += par1World.rand.nextInt(3) - 1; var10 += par1World.rand.nextInt(3) - 1; if (!par2StructureBoundingBox.isVecInside(var8, var9, var10)) { break; } ++this.villagersSpawned; final EntityAlienVillager var11 = new EntityAlienVillager(par1World); var11.setLocationAndAngles(var8 + 0.5D, var9, var10 + 0.5D, 0.0F, 0.0F); par1World.spawnEntityInWorld(var11); } } }
protected boolean func_74879_a( World p_74879_1_, StructureBoundingBox p_74879_2_, Random p_74879_3_, int p_74879_4_, int p_74879_5_, int p_74879_6_, WeightedRandomChestContent[] p_74879_7_, int p_74879_8_) { int var9 = this.func_74865_a(p_74879_4_, p_74879_6_); int var10 = this.func_74862_a(p_74879_5_); int var11 = this.func_74873_b(p_74879_4_, p_74879_6_); if (p_74879_2_.func_78890_b(var9, var10, var11) && p_74879_1_.func_72798_a(var9, var10, var11) != Block.field_72077_au.field_71990_ca) { p_74879_1_.func_72832_d(var9, var10, var11, Block.field_72077_au.field_71990_ca, 0, 2); TileEntityChest var12 = (TileEntityChest) p_74879_1_.func_72796_p(var9, var10, var11); if (var12 != null) { WeightedRandomChestContent.func_76293_a(p_74879_3_, p_74879_7_, var12, p_74879_8_); } return true; } else { return false; } }
/** * Creates and returns a new component piece. Or null if it could not find enough room to place * it. */ public static ComponentNetherBridgeStairs createValidComponent( List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox( par2, par3, par4, -2, 0, 0, 7, 11, 7, par5); return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(par0List, structureboundingbox) == null ? new ComponentNetherBridgeStairs(par6, par1Random, structureboundingbox, par5) : null; }
public static ComponentSkyStrongholdChestCorridor findValidPlacement( List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox( par2, par3, par4, -1, -1, 0, 5, 5, 7, par5); return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(par0List, structureboundingbox) == null ? new ComponentSkyStrongholdChestCorridor(par6, par1Random, structureboundingbox, par5) : null; }
public static VillageComponentCustomCropField buildComponent( List pieces, int p1, int p2, int p3, int p4) { StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox( p1, p2, p3, 0, 0, 0, xSize, ySize, zSize, p4); return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentCustomCropField(boundingBox, p4) : null; }
protected int func_74866_a( World p_74866_1_, int p_74866_2_, int p_74866_3_, int p_74866_4_, StructureBoundingBox p_74866_5_) { int var6 = this.func_74865_a(p_74866_2_, p_74866_4_); int var7 = this.func_74862_a(p_74866_3_); int var8 = this.func_74873_b(p_74866_2_, p_74866_4_); return !p_74866_5_.func_78890_b(var6, var7, var8) ? 0 : p_74866_1_.func_72798_a(var6, var7, var8); }
@SuppressWarnings("rawtypes") public static StructureBoundingBox func_74904_a( GCMoonComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { final StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 4, 2, par6); return StructureComponent.findIntersecting(par1List, var7) != null ? null : var7; }
protected void func_74864_a( World p_74864_1_, int p_74864_2_, int p_74864_3_, int p_74864_4_, int p_74864_5_, int p_74864_6_, StructureBoundingBox p_74864_7_) { int var8 = this.func_74865_a(p_74864_4_, p_74864_6_); int var9 = this.func_74862_a(p_74864_5_); int var10 = this.func_74873_b(p_74864_4_, p_74864_6_); if (p_74864_7_.func_78890_b(var8, var9, var10)) { p_74864_1_.func_72832_d(var8, var9, var10, p_74864_2_, p_74864_3_, 2); } }
protected void func_74881_a( World p_74881_1_, StructureBoundingBox p_74881_2_, Random p_74881_3_, int p_74881_4_, int p_74881_5_, int p_74881_6_, int p_74881_7_) { int var8 = this.func_74865_a(p_74881_4_, p_74881_6_); int var9 = this.func_74862_a(p_74881_5_); int var10 = this.func_74873_b(p_74881_4_, p_74881_6_); if (p_74881_2_.func_78890_b(var8, var9, var10)) { ItemDoor.func_77869_a(p_74881_1_, var8, var9, var10, p_74881_7_, Block.field_72054_aE); } }
protected void func_74871_b( World p_74871_1_, int p_74871_2_, int p_74871_3_, int p_74871_4_, StructureBoundingBox p_74871_5_) { int var6 = this.func_74865_a(p_74871_2_, p_74871_4_); int var7 = this.func_74862_a(p_74871_3_); int var8 = this.func_74873_b(p_74871_2_, p_74871_4_); if (p_74871_5_.func_78890_b(var6, var7, var8)) { while (!p_74871_1_.func_72799_c(var6, var7, var8) && var7 < 255) { p_74871_1_.func_72832_d(var6, var7, var8, 0, 0, 2); ++var7; } } }
public static CustomHouse func_175850_a( StructureVillagePieces.Start p_175850_0_, List p_175850_1_, Random p_175850_2_, int p_175850_3_, int p_175850_4_, int p_175850_5_, EnumFacing p_175850_6_, int p_175850_7_) { StructureBoundingBox structureboundingbox = StructureBoundingBox.func_175897_a( p_175850_3_, p_175850_4_, p_175850_5_, 0, 0, 0, 9, 9, 6, p_175850_6_); return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175850_1_, structureboundingbox) == null ? new CustomHouse(p_175850_0_, p_175850_7_, p_175850_2_, structureboundingbox, p_175850_6_) : null; }
public MapGenClusters$ClusterComponent( MapGenClusters var1, MapGenOreDistribution$StructureGroup var2, float var3, float var4, float var5, Random var6) { super(var1, var2); this.this$0 = var1; this.size = var1.clSize.getIntValue(var6); double var7 = (double) var6.nextFloat() * Math.PI; this.ptA = new float[3]; this.ptB = new float[3]; float var9 = (float) Math.sin(var7) * (float) this.size / 8.0F; float var10 = (float) Math.cos(var7) * (float) this.size / 8.0F; this.ptA[0] = var3 + var9; this.ptB[0] = var3 - var9; this.ptA[2] = var5 + var10; this.ptB[2] = var5 - var10; this.ptA[1] = var4 + (float) var6.nextInt(3) - 2.0F; this.ptB[1] = var4 + (float) var6.nextInt(3) - 2.0F; this.boundingBox = StructureBoundingBox.getNewBoundingBox(); this.rad = new float[this.size + 1]; for (int var11 = 0; var11 < this.rad.length; ++var11) { float var12 = (float) var11 / (float) (this.rad.length - 1); float var13 = (float) var6.nextDouble() * (float) this.size / 32.0F; this.rad[var11] = ((float) Math.sin((double) var12 * Math.PI) + 1.0F) * var13 + 0.5F; float var14 = this.ptA[0] + (this.ptB[0] - this.ptA[0]) * var12; float var15 = this.ptA[1] + (this.ptB[1] - this.ptA[1]) * var12; float var16 = this.ptA[2] + (this.ptB[2] - this.ptA[2]) * var12; this.boundingBox.minX = Math.min(this.boundingBox.minX, MathHelper.floor_float(var14 - this.rad[var11])); this.boundingBox.minY = Math.min(this.boundingBox.minY, MathHelper.floor_float(var15 - this.rad[var11])); this.boundingBox.minZ = Math.min(this.boundingBox.minZ, MathHelper.floor_float(var16 - this.rad[var11])); this.boundingBox.maxX = Math.max(this.boundingBox.maxX, MathHelper.ceiling_float_int(var14 + this.rad[var11])); this.boundingBox.maxY = Math.max(this.boundingBox.maxY, MathHelper.ceiling_float_int(var15 + this.rad[var11])); this.boundingBox.maxZ = Math.max(this.boundingBox.maxZ, MathHelper.ceiling_float_int(var16 + this.rad[var11])); } }
@SuppressWarnings("rawtypes") public static StructureComponentVillageField func_74900_a( StructureComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { final StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox( par3, par4, par5, 0, 0, 0, 13, 4, 9, par6); return StructureComponent.findIntersecting(par1List, var8) == null ? new StructureComponentVillageField( par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; }
protected void func_74870_b( World p_74870_1_, int p_74870_2_, int p_74870_3_, int p_74870_4_, int p_74870_5_, int p_74870_6_, StructureBoundingBox p_74870_7_) { int var8 = this.func_74865_a(p_74870_4_, p_74870_6_); int var9 = this.func_74862_a(p_74870_5_); int var10 = this.func_74873_b(p_74870_4_, p_74870_6_); if (p_74870_7_.func_78890_b(var8, var9, var10)) { while ((p_74870_1_.func_72799_c(var8, var9, var10) || p_74870_1_.func_72803_f(var8, var9, var10).func_76224_d()) && var9 > 1) { p_74870_1_.func_72832_d(var8, var9, var10, p_74870_2_, p_74870_3_, 2); --var9; } } }
/** * Discover the y coordinate that will serve as the ground level of the supplied BoundingBox. (A * median of all the levels in the BB's horizontal rectangle). */ protected int getAverageGroundLevel( World par1World, StructureBoundingBox par2StructureBoundingBox) { int var3 = 0; int var4 = 0; for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { for (int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { if (par2StructureBoundingBox.isVecInside(var6, 64, var5)) { var3 += par1World.getTopSolidOrLiquidBlock(var6, var5); ++var4; } } } if (var4 == 0) { return -1; } else { if (var3 / var4 - 8 < 255) return var3 / var4; else return 255 - 8; } }
protected void hangItemFrame( World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, ItemStack item) { int j1 = this.getXWithOffset(par3, par5); int k1 = this.getYWithOffset(par4); int l1 = this.getZWithOffset(par3, par5); if (!par2StructureBoundingBox.isVecInside(j1, k1, l1)) { return; } int i1 = this.coordBaseMode; EntityItemFrame itemFrame = new EntityItemFrame(par1World, j1, k1, l1, i1); itemFrame.setDisplayedItem(item); if (itemFrame.onValidSurface()) { par1World.spawnEntityInWorld(itemFrame); } }
@SuppressWarnings("rawtypes") public static StructureBoundingBox func_74933_a( StructureComponentSaturnVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { for (int var7 = 7 * MathHelper.getRandomIntegerInRange(par2Random, 3, 5); var7 >= 7; var7 -= 7) { final StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox( par3, par4, par5, 0, 0, 0, 3, 3, var7, par6); if (StructureComponent.findIntersecting(par1List, var8) == null) { return var8; } } return null; }
/** * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it * closes Mineshafts at the end, it adds Fences... */ @Override public boolean addComponentParts( World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { final Block var4 = this.getBiomeSpecificBlock(Blocks.planks, 0); for (int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { if (par3StructureBoundingBox.isVecInside(var5, 64, var6) && (par1World.getBlock(var5, par1World.getTopSolidOrLiquidBlock(var5, var6) - 1, var6) == GCBlocks.blockMoon && par1World.getBlockMetadata( var5, par1World.getTopSolidOrLiquidBlock(var5, var6) - 1, var6) == 5 || Blocks.air == par1World.getBlock( var5, par1World.getTopSolidOrLiquidBlock(var5, var6) - 1, var6))) { final int var7 = par1World.getTopSolidOrLiquidBlock(var5, var6) - 1; par1World.setBlock(var5, var7, var6, var4, 1, 3); } } } return true; }
/** Callback when the command is invoked */ public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (args.length < 9) { throw new WrongUsageException("commands.compare.usage", new Object[0]); } else { sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); BlockPos blockpos = parseBlockPos(sender, args, 0, false); BlockPos blockpos1 = parseBlockPos(sender, args, 3, false); BlockPos blockpos2 = parseBlockPos(sender, args, 6, false); StructureBoundingBox structureboundingbox = new StructureBoundingBox(blockpos, blockpos1); StructureBoundingBox structureboundingbox1 = new StructureBoundingBox(blockpos2, blockpos2.add(structureboundingbox.func_175896_b())); int i = structureboundingbox.getXSize() * structureboundingbox.getYSize() * structureboundingbox.getZSize(); if (i > 524288) { throw new CommandException( "commands.compare.tooManyBlocks", new Object[] {Integer.valueOf(i), Integer.valueOf(524288)}); } else if (structureboundingbox.minY >= 0 && structureboundingbox.maxY < 256 && structureboundingbox1.minY >= 0 && structureboundingbox1.maxY < 256) { World world = sender.getEntityWorld(); if (world.isAreaLoaded(structureboundingbox) && world.isAreaLoaded(structureboundingbox1)) { boolean flag = false; if (args.length > 9 && args[9].equals("masked")) { flag = true; } i = 0; BlockPos blockpos3 = new BlockPos( structureboundingbox1.minX - structureboundingbox.minX, structureboundingbox1.minY - structureboundingbox.minY, structureboundingbox1.minZ - structureboundingbox.minZ); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); for (int j = structureboundingbox.minZ; j <= structureboundingbox.maxZ; ++j) { for (int k = structureboundingbox.minY; k <= structureboundingbox.maxY; ++k) { for (int l = structureboundingbox.minX; l <= structureboundingbox.maxX; ++l) { blockpos$mutableblockpos.func_181079_c(l, k, j); blockpos$mutableblockpos1.func_181079_c( l + blockpos3.getX(), k + blockpos3.getY(), j + blockpos3.getZ()); boolean flag1 = false; IBlockState iblockstate = world.getBlockState(blockpos$mutableblockpos); if (!flag || iblockstate.getBlock() != Blocks.air) { if (iblockstate == world.getBlockState(blockpos$mutableblockpos1)) { TileEntity tileentity = world.getTileEntity(blockpos$mutableblockpos); TileEntity tileentity1 = world.getTileEntity(blockpos$mutableblockpos1); if (tileentity != null && tileentity1 != null) { NBTTagCompound nbttagcompound = new NBTTagCompound(); tileentity.writeToNBT(nbttagcompound); nbttagcompound.removeTag("x"); nbttagcompound.removeTag("y"); nbttagcompound.removeTag("z"); NBTTagCompound nbttagcompound1 = new NBTTagCompound(); tileentity1.writeToNBT(nbttagcompound1); nbttagcompound1.removeTag("x"); nbttagcompound1.removeTag("y"); nbttagcompound1.removeTag("z"); if (!nbttagcompound.equals(nbttagcompound1)) { flag1 = true; } } else if (tileentity != null) { flag1 = true; } } else { flag1 = true; } ++i; if (flag1) { throw new CommandException("commands.compare.failed", new Object[0]); } } } } } sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, i); notifyOperators( sender, this, "commands.compare.success", new Object[] {Integer.valueOf(i)}); } else { throw new CommandException("commands.compare.outOfWorld", new Object[0]); } } else { throw new CommandException("commands.compare.outOfWorld", new Object[0]); } } }
/** * 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 (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) { return false; } else { this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 1, 1, 1, 5, 1, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 1, 4, 2, 5, 4, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 2, 1, 0, 4, 1, 0, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 2, 2, 2, 3, 3, 2, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 1, 2, 3, 1, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 5, 2, 3, 5, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 2, 2, 7, 4, 3, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 0, 2, 1, 3, 2, Block.wood.blockID, Block.wood.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 5, 0, 2, 5, 3, 2, Block.wood.blockID, Block.wood.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 0, 7, 1, 3, 7, Block.wood.blockID, Block.wood.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 5, 0, 7, 5, 3, 7, Block.wood.blockID, Block.wood.blockID, false); this.placeBlockAtCurrentPosition( par1World, Block.fence.blockID, 0, 2, 3, 2, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.fence.blockID, 0, 3, 3, 7, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 3, 4, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 4, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 5, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.flowerPot.blockID, 7, 1, 3, 5, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.workbench.blockID, 0, 3, 2, 6, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.cauldron.blockID, 0, 4, 2, 6, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.fence.blockID, 0, 1, 2, 1, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.fence.blockID, 0, 5, 2, 1, par3StructureBoundingBox); int i = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); int j = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1); int k = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0); int l = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 0, 4, 1, 6, 4, 1, Block.stairsWoodSpruce.blockID, i, Block.stairsWoodSpruce.blockID, i, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 0, 4, 2, 0, 4, 7, Block.stairsWoodSpruce.blockID, k, Block.stairsWoodSpruce.blockID, k, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 6, 4, 2, 6, 4, 7, Block.stairsWoodSpruce.blockID, j, Block.stairsWoodSpruce.blockID, j, false); this.fillWithMetadataBlocks( par1World, par3StructureBoundingBox, 0, 4, 8, 6, 4, 8, Block.stairsWoodSpruce.blockID, l, Block.stairsWoodSpruce.blockID, l, false); int i1; int j1; for (i1 = 2; i1 <= 7; i1 += 5) { for (j1 = 1; j1 <= 5; j1 += 4) { this.fillCurrentPositionBlocksDownwards( par1World, Block.wood.blockID, 0, j1, -1, i1, par3StructureBoundingBox); } } if (!this.hasWitch) { i1 = this.getXWithOffset(2, 5); j1 = this.getYWithOffset(2); int k1 = this.getZWithOffset(2, 5); if (par3StructureBoundingBox.isVecInside(i1, j1, k1)) { this.hasWitch = true; EntityWitch entitywitch = new EntityWitch(par1World); entitywitch.setLocationAndAngles( (double) i1 + 0.5D, (double) j1, (double) k1 + 0.5D, 0.0F, 0.0F); entitywitch.onSpawnWithEgg((EntityLivingData) null); par1World.spawnEntityInWorld(entitywitch); } } return true; } }
/** * 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) { BiomeGenBase biomegenbase = par1World.getBiomeGenForCoords(this.getXWithOffset(3, 5), this.getZWithOffset(3, 5)); this.fillWithBlocks( par1World, par3StructureBoundingBox, -1, -1, 0, 5, 5, 6, Block.stone.blockID, Block.stone.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, -1, 5, 0, 5, 5, 6, biomegenbase.topBlock, biomegenbase.topBlock, false); this.fillWithRandomizedBlocks( par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, false, par2Random, StructureSkyStrongholdPieces.getStrongholdStones()); this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.doorType, 1, 1, 0); this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6); this.fillWithBlocks( par1World, par3StructureBoundingBox, 3, 1, 2, 3, 1, 4, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); this.placeBlockAtCurrentPosition( par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 1, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 5, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 2, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 4, par3StructureBoundingBox); int i; for (i = 2; i <= 4; ++i) { this.placeBlockAtCurrentPosition( par1World, Block.stoneSingleSlab.blockID, 5, 2, 1, i, par3StructureBoundingBox); } if (!this.hasMadeChest) { i = this.getYWithOffset(2); int j = this.getXWithOffset(3, 3); int k = this.getZWithOffset(3, 3); if (par3StructureBoundingBox.isVecInside(j, i, k)) { this.hasMadeChest = true; this.generateStructureChestContents( par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, ChestGenHooks.getItems(STRONGHOLD_CORRIDOR, par2Random), ChestGenHooks.getCount(STRONGHOLD_CORRIDOR, par2Random)); } } return true; }
/** * 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) { this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 7, 7, 0, 0, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 0, 0, 5, 1, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 2, 1, 5, 2, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 3, 2, 5, 3, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 4, 3, 5, 4, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 2, 0, 1, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 5, 2, 0, 5, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 5, 2, 1, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 5, 5, 2, 5, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 0, 5, 3, 0, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 6, 5, 3, 6, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 5, 8, 5, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.placeBlockAtCurrentPosition( par1World, Block.netherFence.blockID, 0, 1, 6, 3, par3StructureBoundingBox); this.placeBlockAtCurrentPosition( par1World, Block.netherFence.blockID, 0, 5, 6, 3, par3StructureBoundingBox); this.fillWithBlocks( par1World, par3StructureBoundingBox, 0, 6, 3, 0, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 6, 6, 3, 6, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 1, 6, 8, 5, 7, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); this.fillWithBlocks( par1World, par3StructureBoundingBox, 2, 8, 8, 4, 8, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); int i; int j; if (!this.hasSpawner) { i = this.getYWithOffset(5); j = this.getXWithOffset(3, 5); int k = this.getZWithOffset(3, 5); if (par3StructureBoundingBox.isVecInside(j, i, k)) { this.hasSpawner = true; par1World.setBlock(j, i, k, Block.mobSpawner.blockID, 0, 2); TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) par1World.getBlockTileEntity(j, i, k); if (tileentitymobspawner != null) { tileentitymobspawner.func_98049_a().setMobID("Blaze"); } } } for (i = 0; i <= 6; ++i) { for (j = 0; j <= 6; ++j) { this.fillCurrentPositionBlocksDownwards( par1World, Block.netherBrick.blockID, 0, i, -1, j, par3StructureBoundingBox); } } return true; }
public static StructureBoundingBox getStructureBoundingBox( int par3, int par4, int par5, int par6) { return StructureBoundingBox.getComponentToAddBoundingBox( par3, par4, par5, 0, -4, 0, 9, 6, 7, par6); }