001 package net.minecraft.src; 002 003 import java.util.Random; 004 005 public class ComponentScatteredFeatureJunglePyramid extends ComponentScatteredFeature 006 { 007 private boolean field_74947_h; 008 private boolean field_74948_i; 009 private boolean field_74945_j; 010 private boolean field_74946_k; 011 private static final WeightedRandomChestContent[] field_74943_l = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.shiftedIndex, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.shiftedIndex, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.shiftedIndex, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.shiftedIndex, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.shiftedIndex, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.shiftedIndex, 0, 3, 7, 16)}; 012 private static final WeightedRandomChestContent[] field_74944_m = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.arrow.shiftedIndex, 0, 2, 7, 30)}; 013 private static StructureScatteredFeatureStones field_74942_n = new StructureScatteredFeatureStones((ComponentScatteredFeaturePieces2)null); 014 015 public ComponentScatteredFeatureJunglePyramid(Random par1Random, int par2, int par3) 016 { 017 super(par1Random, par2, 64, par3, 12, 10, 15); 018 } 019 020 /** 021 * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at 022 * the end, it adds Fences... 023 */ 024 public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) 025 { 026 if (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) 027 { 028 return false; 029 } 030 else 031 { 032 int var4 = this.getMetadataWithOffset(Block.stairCompactCobblestone.blockID, 3); 033 int var5 = this.getMetadataWithOffset(Block.stairCompactCobblestone.blockID, 2); 034 int var6 = this.getMetadataWithOffset(Block.stairCompactCobblestone.blockID, 0); 035 int var7 = this.getMetadataWithOffset(Block.stairCompactCobblestone.blockID, 1); 036 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, -4, 0, this.field_74939_a - 1, 0, this.field_74938_c - 1, false, par2Random, field_74942_n); 037 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 2, 9, 2, 2, false, par2Random, field_74942_n); 038 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 12, 9, 2, 12, false, par2Random, field_74942_n); 039 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 3, 2, 2, 11, false, par2Random, field_74942_n); 040 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 1, 3, 9, 2, 11, false, par2Random, field_74942_n); 041 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 1, 10, 6, 1, false, par2Random, field_74942_n); 042 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 13, 10, 6, 13, false, par2Random, field_74942_n); 043 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 2, 1, 6, 12, false, par2Random, field_74942_n); 044 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, 3, 2, 10, 6, 12, false, par2Random, field_74942_n); 045 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 3, 2, 9, 3, 12, false, par2Random, field_74942_n); 046 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 6, 2, 9, 6, 12, false, par2Random, field_74942_n); 047 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 7, 3, 8, 7, 11, false, par2Random, field_74942_n); 048 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 8, 4, 7, 8, 10, false, par2Random, field_74942_n); 049 this.func_74878_a(par1World, par3StructureBoundingBox, 3, 1, 3, 8, 2, 11); 050 this.func_74878_a(par1World, par3StructureBoundingBox, 4, 3, 6, 7, 3, 9); 051 this.func_74878_a(par1World, par3StructureBoundingBox, 2, 4, 2, 9, 5, 12); 052 this.func_74878_a(par1World, par3StructureBoundingBox, 4, 6, 5, 7, 6, 9); 053 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 7, 6, 6, 7, 8); 054 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 1, 2, 6, 2, 2); 055 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 2, 12, 6, 2, 12); 056 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 5, 1, 6, 5, 1); 057 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 5, 13, 6, 5, 13); 058 this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 5, par3StructureBoundingBox); 059 this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 5, par3StructureBoundingBox); 060 this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 9, par3StructureBoundingBox); 061 this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 9, par3StructureBoundingBox); 062 int var8; 063 064 for (var8 = 0; var8 <= 14; var8 += 14) 065 { 066 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 4, var8, 2, 5, var8, false, par2Random, field_74942_n); 067 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 4, var8, 4, 5, var8, false, par2Random, field_74942_n); 068 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 4, var8, 7, 5, var8, false, par2Random, field_74942_n); 069 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 4, var8, 9, 5, var8, false, par2Random, field_74942_n); 070 } 071 072 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 6, 0, 6, 6, 0, false, par2Random, field_74942_n); 073 074 for (var8 = 0; var8 <= 11; var8 += 11) 075 { 076 for (int var9 = 2; var9 <= 12; var9 += 2) 077 { 078 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 4, var9, var8, 5, var9, false, par2Random, field_74942_n); 079 } 080 081 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 5, var8, 6, 5, false, par2Random, field_74942_n); 082 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 9, var8, 6, 9, false, par2Random, field_74942_n); 083 } 084 085 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 2, 2, 9, 2, false, par2Random, field_74942_n); 086 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 2, 9, 9, 2, false, par2Random, field_74942_n); 087 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 12, 2, 9, 12, false, par2Random, field_74942_n); 088 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 12, 9, 9, 12, false, par2Random, field_74942_n); 089 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 4, 4, 9, 4, false, par2Random, field_74942_n); 090 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 4, 7, 9, 4, false, par2Random, field_74942_n); 091 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 10, 4, 9, 10, false, par2Random, field_74942_n); 092 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 10, 7, 9, 10, false, par2Random, field_74942_n); 093 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 9, 7, 6, 9, 7, false, par2Random, field_74942_n); 094 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 5, 9, 6, par3StructureBoundingBox); 095 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 6, 9, 6, par3StructureBoundingBox); 096 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var5, 5, 9, 8, par3StructureBoundingBox); 097 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var5, 6, 9, 8, par3StructureBoundingBox); 098 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 4, 0, 0, par3StructureBoundingBox); 099 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 5, 0, 0, par3StructureBoundingBox); 100 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 6, 0, 0, par3StructureBoundingBox); 101 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 7, 0, 0, par3StructureBoundingBox); 102 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 4, 1, 8, par3StructureBoundingBox); 103 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 4, 2, 9, par3StructureBoundingBox); 104 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 4, 3, 10, par3StructureBoundingBox); 105 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 7, 1, 8, par3StructureBoundingBox); 106 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 7, 2, 9, par3StructureBoundingBox); 107 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 7, 3, 10, par3StructureBoundingBox); 108 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 4, 1, 9, false, par2Random, field_74942_n); 109 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 1, 9, 7, 1, 9, false, par2Random, field_74942_n); 110 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 7, 2, 10, false, par2Random, field_74942_n); 111 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 4, 5, 6, 4, 5, false, par2Random, field_74942_n); 112 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var6, 4, 4, 5, par3StructureBoundingBox); 113 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var7, 7, 4, 5, par3StructureBoundingBox); 114 115 for (var8 = 0; var8 < 4; ++var8) 116 { 117 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var5, 5, 0 - var8, 6 + var8, par3StructureBoundingBox); 118 this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var5, 6, 0 - var8, 6 + var8, par3StructureBoundingBox); 119 this.func_74878_a(par1World, par3StructureBoundingBox, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); 120 } 121 122 this.func_74878_a(par1World, par3StructureBoundingBox, 1, -3, 12, 10, -1, 13); 123 this.func_74878_a(par1World, par3StructureBoundingBox, 1, -3, 1, 3, -1, 13); 124 this.func_74878_a(par1World, par3StructureBoundingBox, 1, -3, 1, 9, -1, 5); 125 126 for (var8 = 1; var8 <= 13; var8 += 2) 127 { 128 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -3, var8, 1, -2, var8, false, par2Random, field_74942_n); 129 } 130 131 for (var8 = 2; var8 <= 12; var8 += 2) 132 { 133 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -1, var8, 3, -1, var8, false, par2Random, field_74942_n); 134 } 135 136 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, -2, 1, 5, -2, 1, false, par2Random, field_74942_n); 137 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, -2, 1, 9, -2, 1, false, par2Random, field_74942_n); 138 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -3, 1, 6, -3, 1, false, par2Random, field_74942_n); 139 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -1, 1, 6, -1, 1, false, par2Random, field_74942_n); 140 this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 3) | 4, 1, -3, 8, par3StructureBoundingBox); 141 this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 1) | 4, 4, -3, 8, par3StructureBoundingBox); 142 this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 2, -3, 8, par3StructureBoundingBox); 143 this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 3, -3, 8, par3StructureBoundingBox); 144 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 7, par3StructureBoundingBox); 145 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 6, par3StructureBoundingBox); 146 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 5, par3StructureBoundingBox); 147 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 4, par3StructureBoundingBox); 148 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 3, par3StructureBoundingBox); 149 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 2, par3StructureBoundingBox); 150 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 1, par3StructureBoundingBox); 151 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 4, -3, 1, par3StructureBoundingBox); 152 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, par3StructureBoundingBox); 153 154 if (!this.field_74945_j) 155 { 156 this.field_74945_j = this.func_74869_a(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, field_74944_m, 2); 157 } 158 159 this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 3, -2, 2, par3StructureBoundingBox); 160 this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 2) | 4, 7, -3, 1, par3StructureBoundingBox); 161 this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 0) | 4, 7, -3, 5, par3StructureBoundingBox); 162 this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 2, par3StructureBoundingBox); 163 this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 3, par3StructureBoundingBox); 164 this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 4, par3StructureBoundingBox); 165 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -3, 6, par3StructureBoundingBox); 166 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 6, par3StructureBoundingBox); 167 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 5, par3StructureBoundingBox); 168 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 4, par3StructureBoundingBox); 169 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -2, 4, par3StructureBoundingBox); 170 171 if (!this.field_74946_k) 172 { 173 this.field_74946_k = this.func_74869_a(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, field_74944_m, 2); 174 } 175 176 this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -1, 3, par3StructureBoundingBox); 177 this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -2, 3, par3StructureBoundingBox); 178 179 if (!this.field_74947_h) 180 { 181 this.field_74947_h = this.func_74879_a(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, field_74943_l, 2 + par2Random.nextInt(5)); 182 } 183 184 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 2, par3StructureBoundingBox); 185 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 1, par3StructureBoundingBox); 186 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 4, -3, 5, par3StructureBoundingBox); 187 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -2, 5, par3StructureBoundingBox); 188 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -1, 5, par3StructureBoundingBox); 189 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 6, -3, 5, par3StructureBoundingBox); 190 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -2, 5, par3StructureBoundingBox); 191 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -1, 5, par3StructureBoundingBox); 192 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 5, par3StructureBoundingBox); 193 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, -1, 1, 9, -1, 5, false, par2Random, field_74942_n); 194 this.func_74878_a(par1World, par3StructureBoundingBox, 8, -3, 8, 10, -1, 10); 195 this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 8, -2, 11, par3StructureBoundingBox); 196 this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 9, -2, 11, par3StructureBoundingBox); 197 this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 10, -2, 11, par3StructureBoundingBox); 198 this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 8, -2, 12, par3StructureBoundingBox); 199 this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 9, -2, 12, par3StructureBoundingBox); 200 this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 10, -2, 12, par3StructureBoundingBox); 201 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, -3, 8, 8, -3, 10, false, par2Random, field_74942_n); 202 this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, -3, 8, 10, -3, 10, false, par2Random, field_74942_n); 203 this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 10, -2, 9, par3StructureBoundingBox); 204 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 9, par3StructureBoundingBox); 205 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 10, par3StructureBoundingBox); 206 this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 10, -1, 9, par3StructureBoundingBox); 207 this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, 1, 9, -2, 8, par3StructureBoundingBox); 208 this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -2, 8, par3StructureBoundingBox); 209 this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -1, 8, par3StructureBoundingBox); 210 this.placeBlockAtCurrentPosition(par1World, Block.redstoneRepeaterIdle.blockID, this.getMetadataWithOffset(Block.redstoneRepeaterIdle.blockID, 2), 10, -2, 10, par3StructureBoundingBox); 211 212 if (!this.field_74948_i) 213 { 214 this.field_74948_i = this.func_74879_a(par1World, par3StructureBoundingBox, par2Random, 9, -3, 10, field_74943_l, 2 + par2Random.nextInt(5)); 215 } 216 217 return true; 218 } 219 } 220 }