StructureStrongholdPieces .java

net.minecraft.world.gen.structure.StructureStrongholdPieces (class, 1639 lines): members: registerStrongholdPieces, prepareStructurePieces, StairsStraight.

net.minecraft.world.gen.structureclass1,639 linescommon97.5 KB

API Surface (65)

boolean canSpawnMoreStructuresOfType(int p_75189_1_)
boolean canSpawnMoreStructuresOfType(int p_75189_1_)
void registerStrongholdPieces()
void prepareStructurePieces()
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.ChestCorridor func_175868_a(List<StructureComponent> p_175868_0_, Random p_175868_1_, int p_175868_2_, int p_175868_3_, int p_175868_4_, EnumFacing p_175868_5_, int p_175868_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
StructureBoundingBox func_175869_a(List<StructureComponent> p_175869_0_, Random p_175869_1_, int p_175869_2_, int p_175869_3_, int p_175869_4_, EnumFacing p_175869_5_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.Crossing func_175866_a(List<StructureComponent> p_175866_0_, Random p_175866_1_, int p_175866_2_, int p_175866_3_, int p_175866_4_, EnumFacing p_175866_5_, int p_175866_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.LeftTurn func_175867_a(List<StructureComponent> p_175867_0_, Random p_175867_1_, int p_175867_2_, int p_175867_3_, int p_175867_4_, EnumFacing p_175867_5_, int p_175867_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
StructureStrongholdPieces.Library func_175864_a(List<StructureComponent> p_175864_0_, Random p_175864_1_, int p_175864_2_, int p_175864_3_, int p_175864_4_, EnumFacing p_175864_5_, int p_175864_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
boolean canSpawnMoreStructuresOfType(int p_75189_1_)
boolean canSpawnMoreStructures()
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.PortalRoom func_175865_a(List<StructureComponent> p_175865_0_, Random p_175865_1_, int p_175865_2_, int p_175865_3_, int p_175865_4_, EnumFacing p_175865_5_, int p_175865_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.Prison func_175860_a(List<StructureComponent> p_175860_0_, Random p_175860_1_, int p_175860_2_, int p_175860_3_, int p_175860_4_, EnumFacing p_175860_5_, int p_175860_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.RoomCrossing func_175859_a(List<StructureComponent> p_175859_0_, Random p_175859_1_, int p_175859_2_, int p_175859_3_, int p_175859_4_, EnumFacing p_175859_5_, int p_175859_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.Stairs func_175863_a(List<StructureComponent> p_175863_0_, Random p_175863_1_, int p_175863_2_, int p_175863_3_, int p_175863_4_, EnumFacing p_175863_5_, int p_175863_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
BlockPos getBoundingBoxCenter()
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.StairsStraight func_175861_a(List<StructureComponent> p_175861_0_, Random p_175861_1_, int p_175861_2_, int p_175861_3_, int p_175861_4_, EnumFacing p_175861_5_, int p_175861_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
StructureStrongholdPieces.Straight func_175862_a(List<StructureComponent> p_175862_0_, Random p_175862_1_, int p_175862_2_, int p_175862_3_, int p_175862_4_, EnumFacing p_175862_5_, int p_175862_6_)
boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
void writeStructureToNBT(NBTTagCompound tagCompound)
void readStructureFromNBT(NBTTagCompound tagCompound)
void placeDoor(World worldIn, Random p_74990_2_, StructureBoundingBox p_74990_3_, StructureStrongholdPieces.Stronghold.Door p_74990_4_, int p_74990_5_, int p_74990_6_, int p_74990_7_)
StructureStrongholdPieces.Stronghold.Door getRandomDoor(Random p_74988_1_)
StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 p_74986_1_, List<StructureComponent> p_74986_2_, Random p_74986_3_, int p_74986_4_, int p_74986_5_)
StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 p_74989_1_, List<StructureComponent> p_74989_2_, Random p_74989_3_, int p_74989_4_, int p_74989_5_)
StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 p_74987_1_, List<StructureComponent> p_74987_2_, Random p_74987_3_, int p_74987_4_, int p_74987_5_)
boolean canStrongholdGoDeeper(StructureBoundingBox p_74991_0_)

Fields & Constants (5)

pieceWeightArray
strongholdStones
structurePieceList
strongComponentType
totalWeight

String literals (24)

"incomplete-switch"
"SHCC"
"SHFC"
"SHLT"
"SHLi"
"SHPR"
"SHPH"
"SHRT"
"SHRC"
"SHSD"
"SHStart"
"SHSSD"
"Chest"
"Steps"
"leftLow"
"leftHigh"
"rightLow"
"rightHigh"
"Tall"
"Silverfish"
"Source"
"Left"
"Right"
"EntryDoor"

Full Source

StructureStrongholdPieces.java1639 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.gen.structure;
2
3
import com.google.common.collect.Lists;
4
import java.util.List;
5
import java.util.Random;
6
import net.minecraft.block.BlockEndPortalFrame;
7
import net.minecraft.block.BlockSilverfish;
8
import net.minecraft.block.BlockStoneBrick;
9
import net.minecraft.block.BlockStoneSlab;
10
import net.minecraft.init.Blocks;
11
import net.minecraft.init.Items;
12
import net.minecraft.nbt.NBTTagCompound;
13
import net.minecraft.tileentity.TileEntity;
14
import net.minecraft.tileentity.TileEntityMobSpawner;
15
import net.minecraft.util.BlockPos;
16
import net.minecraft.util.EnumFacing;
17
import net.minecraft.util.WeightedRandomChestContent;
18
import net.minecraft.world.World;
19
20
@SuppressWarnings("incomplete-switch")
21
public class StructureStrongholdPieces
22
{
23
    private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2)
24
        {
25
            public boolean canSpawnMoreStructuresOfType(int p_75189_1_)
26
            {
27
                return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 4;
28
            }
29
        }, new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.PortalRoom.class, 20, 1)
30
        {
31
            public boolean canSpawnMoreStructuresOfType(int p_75189_1_)
32
            {
33
                return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 5;
34
            }
35
        }
36
    };
37
    private static List<StructureStrongholdPieces.PieceWeight> structurePieceList;
38
    private static Class <? extends StructureStrongholdPieces.Stronghold > strongComponentType;
39
    static int totalWeight;
40
    private static final StructureStrongholdPieces.Stones strongholdStones = new StructureStrongholdPieces.Stones();
41
42
    public static void registerStrongholdPieces()
43
    {
44
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.ChestCorridor.class, "SHCC");
45
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Corridor.class, "SHFC");
46
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Crossing.class, "SH5C");
47
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.LeftTurn.class, "SHLT");
48
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Library.class, "SHLi");
49
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.PortalRoom.class, "SHPR");
50
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Prison.class, "SHPH");
51
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RightTurn.class, "SHRT");
52
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RoomCrossing.class, "SHRC");
53
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs.class, "SHSD");
54
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs2.class, "SHStart");
55
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Straight.class, "SHS");
56
        MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.StairsStraight.class, "SHSSD");
57
    }
58
59
    /**
60
     * sets up Arrays with the Structure pieces and their weights
61
     */
62
    public static void prepareStructurePieces()
63
    {
64
        structurePieceList = Lists.<StructureStrongholdPieces.PieceWeight>newArrayList();
65
66
        for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : pieceWeightArray)
67
        {
68
            structurestrongholdpieces$pieceweight.instancesSpawned = 0;
69
            structurePieceList.add(structurestrongholdpieces$pieceweight);
70
        }
71
72
        strongComponentType = null;
73
    }
74
75
    private static boolean canAddStructurePieces()
76
    {
77
        boolean flag = false;
78
        totalWeight = 0;
79
80
        for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList)
81
        {
82
            if (structurestrongholdpieces$pieceweight.instancesLimit > 0 && structurestrongholdpieces$pieceweight.instancesSpawned < structurestrongholdpieces$pieceweight.instancesLimit)
83
            {
84
                flag = true;
85
            }
86
87
            totalWeight += structurestrongholdpieces$pieceweight.pieceWeight;
88
        }
89
90
        return flag;
91
    }
92
93
    private static StructureStrongholdPieces.Stronghold func_175954_a(Class <? extends StructureStrongholdPieces.Stronghold > p_175954_0_, List<StructureComponent> p_175954_1_, Random p_175954_2_, int p_175954_3_, int p_175954_4_, int p_175954_5_, EnumFacing p_175954_6_, int p_175954_7_)
94
    {
95
        StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = null;
96
97
        if (p_175954_0_ == StructureStrongholdPieces.Straight.class)
98
        {
99
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.Straight.func_175862_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
100
        }
101
        else if (p_175954_0_ == StructureStrongholdPieces.Prison.class)
102
        {
103
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.Prison.func_175860_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
104
        }
105
        else if (p_175954_0_ == StructureStrongholdPieces.LeftTurn.class)
106
        {
107
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.LeftTurn.func_175867_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
108
        }
109
        else if (p_175954_0_ == StructureStrongholdPieces.RightTurn.class)
110
        {
111
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.RightTurn.func_175867_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
112
        }
113
        else if (p_175954_0_ == StructureStrongholdPieces.RoomCrossing.class)
114
        {
115
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.RoomCrossing.func_175859_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
116
        }
117
        else if (p_175954_0_ == StructureStrongholdPieces.StairsStraight.class)
118
        {
119
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.StairsStraight.func_175861_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
120
        }
121
        else if (p_175954_0_ == StructureStrongholdPieces.Stairs.class)
122
        {
123
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.Stairs.func_175863_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
124
        }
125
        else if (p_175954_0_ == StructureStrongholdPieces.Crossing.class)
126
        {
127
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.Crossing.func_175866_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
128
        }
129
        else if (p_175954_0_ == StructureStrongholdPieces.ChestCorridor.class)
130
        {
131
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.ChestCorridor.func_175868_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
132
        }
133
        else if (p_175954_0_ == StructureStrongholdPieces.Library.class)
134
        {
135
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.Library.func_175864_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
136
        }
137
        else if (p_175954_0_ == StructureStrongholdPieces.PortalRoom.class)
138
        {
139
            structurestrongholdpieces$stronghold = StructureStrongholdPieces.PortalRoom.func_175865_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_);
140
        }
141
142
        return structurestrongholdpieces$stronghold;
143
    }
144
145
    private static StructureStrongholdPieces.Stronghold func_175955_b(StructureStrongholdPieces.Stairs2 p_175955_0_, List<StructureComponent> p_175955_1_, Random p_175955_2_, int p_175955_3_, int p_175955_4_, int p_175955_5_, EnumFacing p_175955_6_, int p_175955_7_)
146
    {
147
        if (!canAddStructurePieces())
148
        {
149
            return null;
150
        }
151
        else
152
        {
153
            if (strongComponentType != null)
154
            {
155
                StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = func_175954_a(strongComponentType, p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_, p_175955_7_);
156
                strongComponentType = null;
157
158
                if (structurestrongholdpieces$stronghold != null)
159
                {
160
                    return structurestrongholdpieces$stronghold;
161
                }
162
            }
163
164
            int j = 0;
165
166
            while (j < 5)
167
            {
168
                ++j;
169
                int i = p_175955_2_.nextInt(totalWeight);
170
171
                for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList)
172
                {
173
                    i -= structurestrongholdpieces$pieceweight.pieceWeight;
174
175
                    if (i < 0)
176
                    {
177
                        if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructuresOfType(p_175955_7_) || structurestrongholdpieces$pieceweight == p_175955_0_.strongholdPieceWeight)
178
                        {
179
                            break;
180
                        }
181
182
                        StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold1 = func_175954_a(structurestrongholdpieces$pieceweight.pieceClass, p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_, p_175955_7_);
183
184
                        if (structurestrongholdpieces$stronghold1 != null)
185
                        {
186
                            ++structurestrongholdpieces$pieceweight.instancesSpawned;
187
                            p_175955_0_.strongholdPieceWeight = structurestrongholdpieces$pieceweight;
188
189
                            if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructures())
190
                            {
191
                                structurePieceList.remove(structurestrongholdpieces$pieceweight);
192
                            }
193
194
                            return structurestrongholdpieces$stronghold1;
195
                        }
196
                    }
197
                }
198
            }
199
200
            StructureBoundingBox structureboundingbox = StructureStrongholdPieces.Corridor.func_175869_a(p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_);
201
202
            if (structureboundingbox != null && structureboundingbox.minY > 1)
203
            {
204
                return new StructureStrongholdPieces.Corridor(p_175955_7_, p_175955_2_, structureboundingbox, p_175955_6_);
205
            }
206
            else
207
            {
208
                return null;
209
            }
210
        }
211
    }
212
213
    private static StructureComponent func_175953_c(StructureStrongholdPieces.Stairs2 p_175953_0_, List<StructureComponent> p_175953_1_, Random p_175953_2_, int p_175953_3_, int p_175953_4_, int p_175953_5_, EnumFacing p_175953_6_, int p_175953_7_)
214
    {
215
        if (p_175953_7_ > 50)
216
        {
217
            return null;
218
        }
219
        else if (Math.abs(p_175953_3_ - p_175953_0_.getBoundingBox().minX) <= 112 && Math.abs(p_175953_5_ - p_175953_0_.getBoundingBox().minZ) <= 112)
220
        {
221
            StructureComponent structurecomponent = func_175955_b(p_175953_0_, p_175953_1_, p_175953_2_, p_175953_3_, p_175953_4_, p_175953_5_, p_175953_6_, p_175953_7_ + 1);
222
223
            if (structurecomponent != null)
224
            {
225
                p_175953_1_.add(structurecomponent);
226
                p_175953_0_.field_75026_c.add(structurecomponent);
227
            }
228
229
            return structurecomponent;
230
        }
231
        else
232
        {
233
            return null;
234
        }
235
    }
236
237
    public static class ChestCorridor extends StructureStrongholdPieces.Stronghold
238
    {
239
        private static final List<WeightedRandomChestContent> strongholdChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.ender_pearl, 0, 1, 1, 10), new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 1), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)});
240
        private boolean hasMadeChest;
241
242
        public ChestCorridor()
243
        {
244
        }
245
246
        public ChestCorridor(int p_i45582_1_, Random p_i45582_2_, StructureBoundingBox p_i45582_3_, EnumFacing p_i45582_4_)
247
        {
248
            super(p_i45582_1_);
249
            this.coordBaseMode = p_i45582_4_;
250
            this.field_143013_d = this.getRandomDoor(p_i45582_2_);
251
            this.boundingBox = p_i45582_3_;
252
        }
253
254
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
255
        {
256
            super.writeStructureToNBT(tagCompound);
257
            tagCompound.setBoolean("Chest", this.hasMadeChest);
258
        }
259
260
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
261
        {
262
            super.readStructureFromNBT(tagCompound);
263
            this.hasMadeChest = tagCompound.getBoolean("Chest");
264
        }
265
266
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
267
        {
268
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
269
        }
270
271
        public static StructureStrongholdPieces.ChestCorridor func_175868_a(List<StructureComponent> p_175868_0_, Random p_175868_1_, int p_175868_2_, int p_175868_3_, int p_175868_4_, EnumFacing p_175868_5_, int p_175868_6_)
272
        {
273
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175868_2_, p_175868_3_, p_175868_4_, -1, -1, 0, 5, 5, 7, p_175868_5_);
274
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175868_0_, structureboundingbox) == null ? new StructureStrongholdPieces.ChestCorridor(p_175868_6_, p_175868_1_, structureboundingbox, p_175868_5_) : null;
275
        }
276
277
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
278
        {
279
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
280
            {
281
                return false;
282
            }
283
            else
284
            {
285
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.strongholdStones);
286
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
287
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6);
288
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 1, 4, Blocks.stonebrick.getDefaultState(), Blocks.stonebrick.getDefaultState(), false);
289
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 1, structureBoundingBoxIn);
290
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 5, structureBoundingBoxIn);
291
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 2, structureBoundingBoxIn);
292
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 4, structureBoundingBoxIn);
293
294
                for (int i = 2; i <= 4; ++i)
295
                {
296
                    this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 2, 1, i, structureBoundingBoxIn);
297
                }
298
299
                if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3))))
300
                {
301
                    this.hasMadeChest = true;
302
                    this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, WeightedRandomChestContent.func_177629_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(2));
303
                }
304
305
                return true;
306
            }
307
        }
308
    }
309
310
    public static class Corridor extends StructureStrongholdPieces.Stronghold
311
    {
312
        private int field_74993_a;
313
314
        public Corridor()
315
        {
316
        }
317
318
        public Corridor(int p_i45581_1_, Random p_i45581_2_, StructureBoundingBox p_i45581_3_, EnumFacing p_i45581_4_)
319
        {
320
            super(p_i45581_1_);
321
            this.coordBaseMode = p_i45581_4_;
322
            this.boundingBox = p_i45581_3_;
323
            this.field_74993_a = p_i45581_4_ != EnumFacing.NORTH && p_i45581_4_ != EnumFacing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize();
324
        }
325
326
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
327
        {
328
            super.writeStructureToNBT(tagCompound);
329
            tagCompound.setInteger("Steps", this.field_74993_a);
330
        }
331
332
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
333
        {
334
            super.readStructureFromNBT(tagCompound);
335
            this.field_74993_a = tagCompound.getInteger("Steps");
336
        }
337
338
        public static StructureBoundingBox func_175869_a(List<StructureComponent> p_175869_0_, Random p_175869_1_, int p_175869_2_, int p_175869_3_, int p_175869_4_, EnumFacing p_175869_5_)
339
        {
340
            int i = 3;
341
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, 4, p_175869_5_);
342
            StructureComponent structurecomponent = StructureComponent.findIntersecting(p_175869_0_, structureboundingbox);
343
344
            if (structurecomponent == null)
345
            {
346
                return null;
347
            }
348
            else
349
            {
350
                if (structurecomponent.getBoundingBox().minY == structureboundingbox.minY)
351
                {
352
                    for (int j = 3; j >= 1; --j)
353
                    {
354
                        structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, j - 1, p_175869_5_);
355
356
                        if (!structurecomponent.getBoundingBox().intersectsWith(structureboundingbox))
357
                        {
358
                            return StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, j, p_175869_5_);
359
                        }
360
                    }
361
                }
362
363
                return null;
364
            }
365
        }
366
367
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
368
        {
369
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
370
            {
371
                return false;
372
            }
373
            else
374
            {
375
                for (int i = 0; i < this.field_74993_a; ++i)
376
                {
377
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, 0, i, structureBoundingBoxIn);
378
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 0, i, structureBoundingBoxIn);
379
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 0, i, structureBoundingBoxIn);
380
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 0, i, structureBoundingBoxIn);
381
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, 0, i, structureBoundingBoxIn);
382
383
                    for (int j = 1; j <= 3; ++j)
384
                    {
385
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, j, i, structureBoundingBoxIn);
386
                        this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, j, i, structureBoundingBoxIn);
387
                        this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, j, i, structureBoundingBoxIn);
388
                        this.setBlockState(worldIn, Blocks.air.getDefaultState(), 3, j, i, structureBoundingBoxIn);
389
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, j, i, structureBoundingBoxIn);
390
                    }
391
392
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, 4, i, structureBoundingBoxIn);
393
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 4, i, structureBoundingBoxIn);
394
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 4, i, structureBoundingBoxIn);
395
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 4, i, structureBoundingBoxIn);
396
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, 4, i, structureBoundingBoxIn);
397
                }
398
399
                return true;
400
            }
401
        }
402
    }
403
404
    public static class Crossing extends StructureStrongholdPieces.Stronghold
405
    {
406
        private boolean field_74996_b;
407
        private boolean field_74997_c;
408
        private boolean field_74995_d;
409
        private boolean field_74999_h;
410
411
        public Crossing()
412
        {
413
        }
414
415
        public Crossing(int p_i45580_1_, Random p_i45580_2_, StructureBoundingBox p_i45580_3_, EnumFacing p_i45580_4_)
416
        {
417
            super(p_i45580_1_);
418
            this.coordBaseMode = p_i45580_4_;
419
            this.field_143013_d = this.getRandomDoor(p_i45580_2_);
420
            this.boundingBox = p_i45580_3_;
421
            this.field_74996_b = p_i45580_2_.nextBoolean();
422
            this.field_74997_c = p_i45580_2_.nextBoolean();
423
            this.field_74995_d = p_i45580_2_.nextBoolean();
424
            this.field_74999_h = p_i45580_2_.nextInt(3) > 0;
425
        }
426
427
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
428
        {
429
            super.writeStructureToNBT(tagCompound);
430
            tagCompound.setBoolean("leftLow", this.field_74996_b);
431
            tagCompound.setBoolean("leftHigh", this.field_74997_c);
432
            tagCompound.setBoolean("rightLow", this.field_74995_d);
433
            tagCompound.setBoolean("rightHigh", this.field_74999_h);
434
        }
435
436
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
437
        {
438
            super.readStructureFromNBT(tagCompound);
439
            this.field_74996_b = tagCompound.getBoolean("leftLow");
440
            this.field_74997_c = tagCompound.getBoolean("leftHigh");
441
            this.field_74995_d = tagCompound.getBoolean("rightLow");
442
            this.field_74999_h = tagCompound.getBoolean("rightHigh");
443
        }
444
445
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
446
        {
447
            int i = 3;
448
            int j = 5;
449
450
            if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH)
451
            {
452
                i = 8 - i;
453
                j = 8 - j;
454
            }
455
456
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 5, 1);
457
458
            if (this.field_74996_b)
459
            {
460
                this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1);
461
            }
462
463
            if (this.field_74997_c)
464
            {
465
                this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7);
466
            }
467
468
            if (this.field_74995_d)
469
            {
470
                this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1);
471
            }
472
473
            if (this.field_74999_h)
474
            {
475
                this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7);
476
            }
477
        }
478
479
        public static StructureStrongholdPieces.Crossing func_175866_a(List<StructureComponent> p_175866_0_, Random p_175866_1_, int p_175866_2_, int p_175866_3_, int p_175866_4_, EnumFacing p_175866_5_, int p_175866_6_)
480
        {
481
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175866_2_, p_175866_3_, p_175866_4_, -4, -3, 0, 10, 9, 11, p_175866_5_);
482
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175866_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Crossing(p_175866_6_, p_175866_1_, structureboundingbox, p_175866_5_) : null;
483
        }
484
485
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
486
        {
487
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
488
            {
489
                return false;
490
            }
491
            else
492
            {
493
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 9, 8, 10, true, randomIn, StructureStrongholdPieces.strongholdStones);
494
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 3, 0);
495
496
                if (this.field_74996_b)
497
                {
498
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 5, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
499
                }
500
501
                if (this.field_74995_d)
502
                {
503
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 3, 1, 9, 5, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
504
                }
505
506
                if (this.field_74997_c)
507
                {
508
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 7, 0, 7, 9, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
509
                }
510
511
                if (this.field_74999_h)
512
                {
513
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 5, 7, 9, 7, 9, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
514
                }
515
516
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 10, 7, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
517
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 2, 1, 8, 2, 6, false, randomIn, StructureStrongholdPieces.strongholdStones);
518
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 5, 4, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones);
519
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, 1, 5, 8, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones);
520
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 4, 7, 3, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones);
521
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 5, 3, 3, 6, false, randomIn, StructureStrongholdPieces.strongholdStones);
522
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 3, 3, 4, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
523
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 6, 3, 4, 6, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
524
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 1, 7, 7, 1, 8, false, randomIn, StructureStrongholdPieces.strongholdStones);
525
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 9, 7, 1, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
526
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 7, 7, 2, 7, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
527
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 7, 4, 5, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
528
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 7, 8, 5, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false);
529
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 7, 7, 5, 9, Blocks.double_stone_slab.getDefaultState(), Blocks.double_stone_slab.getDefaultState(), false);
530
                this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 6, 5, 6, structureBoundingBoxIn);
531
                return true;
532
            }
533
        }
534
    }
535
536
    public static class LeftTurn extends StructureStrongholdPieces.Stronghold
537
    {
538
        public LeftTurn()
539
        {
540
        }
541
542
        public LeftTurn(int p_i45579_1_, Random p_i45579_2_, StructureBoundingBox p_i45579_3_, EnumFacing p_i45579_4_)
543
        {
544
            super(p_i45579_1_);
545
            this.coordBaseMode = p_i45579_4_;
546
            this.field_143013_d = this.getRandomDoor(p_i45579_2_);
547
            this.boundingBox = p_i45579_3_;
548
        }
549
550
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
551
        {
552
            if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
553
            {
554
                this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
555
            }
556
            else
557
            {
558
                this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
559
            }
560
        }
561
562
        public static StructureStrongholdPieces.LeftTurn func_175867_a(List<StructureComponent> p_175867_0_, Random p_175867_1_, int p_175867_2_, int p_175867_3_, int p_175867_4_, EnumFacing p_175867_5_, int p_175867_6_)
563
        {
564
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175867_2_, p_175867_3_, p_175867_4_, -1, -1, 0, 5, 5, 5, p_175867_5_);
565
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175867_0_, structureboundingbox) == null ? new StructureStrongholdPieces.LeftTurn(p_175867_6_, p_175867_1_, structureboundingbox, p_175867_5_) : null;
566
        }
567
568
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
569
        {
570
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
571
            {
572
                return false;
573
            }
574
            else
575
            {
576
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.strongholdStones);
577
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
578
579
                if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
580
                {
581
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
582
                }
583
                else
584
                {
585
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
586
                }
587
588
                return true;
589
            }
590
        }
591
    }
592
593
    public static class Library extends StructureStrongholdPieces.Stronghold
594
    {
595
        private static final List<WeightedRandomChestContent> strongholdLibraryChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)});
596
        private boolean isLargeRoom;
597
598
        public Library()
599
        {
600
        }
601
602
        public Library(int p_i45578_1_, Random p_i45578_2_, StructureBoundingBox p_i45578_3_, EnumFacing p_i45578_4_)
603
        {
604
            super(p_i45578_1_);
605
            this.coordBaseMode = p_i45578_4_;
606
            this.field_143013_d = this.getRandomDoor(p_i45578_2_);
607
            this.boundingBox = p_i45578_3_;
608
            this.isLargeRoom = p_i45578_3_.getYSize() > 6;
609
        }
610
611
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
612
        {
613
            super.writeStructureToNBT(tagCompound);
614
            tagCompound.setBoolean("Tall", this.isLargeRoom);
615
        }
616
617
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
618
        {
619
            super.readStructureFromNBT(tagCompound);
620
            this.isLargeRoom = tagCompound.getBoolean("Tall");
621
        }
622
623
        public static StructureStrongholdPieces.Library func_175864_a(List<StructureComponent> p_175864_0_, Random p_175864_1_, int p_175864_2_, int p_175864_3_, int p_175864_4_, EnumFacing p_175864_5_, int p_175864_6_)
624
        {
625
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175864_2_, p_175864_3_, p_175864_4_, -4, -1, 0, 14, 11, 15, p_175864_5_);
626
627
            if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_175864_0_, structureboundingbox) != null)
628
            {
629
                structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175864_2_, p_175864_3_, p_175864_4_, -4, -1, 0, 14, 6, 15, p_175864_5_);
630
631
                if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_175864_0_, structureboundingbox) != null)
632
                {
633
                    return null;
634
                }
635
            }
636
637
            return new StructureStrongholdPieces.Library(p_175864_6_, p_175864_1_, structureboundingbox, p_175864_5_);
638
        }
639
640
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
641
        {
642
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
643
            {
644
                return false;
645
            }
646
            else
647
            {
648
                int i = 11;
649
650
                if (!this.isLargeRoom)
651
                {
652
                    i = 6;
653
                }
654
655
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 13, i - 1, 14, true, randomIn, StructureStrongholdPieces.strongholdStones);
656
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 1, 0);
657
                this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.07F, 2, 1, 1, 11, 4, 13, Blocks.web.getDefaultState(), Blocks.web.getDefaultState(), false);
658
                int j = 1;
659
                int k = 12;
660
661
                for (int l = 1; l <= 13; ++l)
662
                {
663
                    if ((l - 1) % 4 == 0)
664
                    {
665
                        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
666
                        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
667
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 2, 3, l, structureBoundingBoxIn);
668
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 11, 3, l, structureBoundingBoxIn);
669
670
                        if (this.isLargeRoom)
671
                        {
672
                            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 6, l, 1, 9, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
673
                            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 6, l, 12, 9, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
674
                        }
675
                    }
676
                    else
677
                    {
678
                        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
679
                        this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
680
681
                        if (this.isLargeRoom)
682
                        {
683
                            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 6, l, 1, 9, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
684
                            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 6, l, 12, 9, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
685
                        }
686
                    }
687
                }
688
689
                for (int k1 = 3; k1 < 12; k1 += 2)
690
                {
691
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, k1, 4, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
692
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, k1, 7, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
693
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, k1, 10, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false);
694
                }
695
696
                if (this.isLargeRoom)
697
                {
698
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 3, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
699
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 5, 1, 12, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
700
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 1, 9, 5, 2, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
701
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 12, 9, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
702
                    this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 9, 5, 11, structureBoundingBoxIn);
703
                    this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 5, 11, structureBoundingBoxIn);
704
                    this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 9, 5, 10, structureBoundingBoxIn);
705
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 6, 2, 3, 6, 12, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false);
706
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 6, 2, 10, 6, 10, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false);
707
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 6, 2, 9, 6, 2, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false);
708
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 6, 12, 8, 6, 12, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false);
709
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 9, 6, 11, structureBoundingBoxIn);
710
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 8, 6, 11, structureBoundingBoxIn);
711
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 9, 6, 10, structureBoundingBoxIn);
712
                    int l1 = this.getMetadataWithOffset(Blocks.ladder, 3);
713
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 1, 13, structureBoundingBoxIn);
714
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 2, 13, structureBoundingBoxIn);
715
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 3, 13, structureBoundingBoxIn);
716
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 4, 13, structureBoundingBoxIn);
717
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 5, 13, structureBoundingBoxIn);
718
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 6, 13, structureBoundingBoxIn);
719
                    this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 7, 13, structureBoundingBoxIn);
720
                    int i1 = 7;
721
                    int j1 = 7;
722
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 9, j1, structureBoundingBoxIn);
723
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 9, j1, structureBoundingBoxIn);
724
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 8, j1, structureBoundingBoxIn);
725
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 8, j1, structureBoundingBoxIn);
726
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1, structureBoundingBoxIn);
727
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1, structureBoundingBoxIn);
728
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 2, 7, j1, structureBoundingBoxIn);
729
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 + 1, 7, j1, structureBoundingBoxIn);
730
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1 - 1, structureBoundingBoxIn);
731
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1 + 1, structureBoundingBoxIn);
732
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1 - 1, structureBoundingBoxIn);
733
                    this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1 + 1, structureBoundingBoxIn);
734
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 2, 8, j1, structureBoundingBoxIn);
735
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 + 1, 8, j1, structureBoundingBoxIn);
736
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn);
737
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn);
738
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 - 1, structureBoundingBoxIn);
739
                    this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 + 1, structureBoundingBoxIn);
740
                }
741
742
                this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4));
743
744
                if (this.isLargeRoom)
745
                {
746
                    this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, 9, 1, structureBoundingBoxIn);
747
                    this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4));
748
                }
749
750
                return true;
751
            }
752
        }
753
    }
754
755
    static class PieceWeight
756
    {
757
        public Class <? extends StructureStrongholdPieces.Stronghold > pieceClass;
758
        public final int pieceWeight;
759
        public int instancesSpawned;
760
        public int instancesLimit;
761
762
        public PieceWeight(Class <? extends StructureStrongholdPieces.Stronghold > p_i2076_1_, int p_i2076_2_, int p_i2076_3_)
763
        {
764
            this.pieceClass = p_i2076_1_;
765
            this.pieceWeight = p_i2076_2_;
766
            this.instancesLimit = p_i2076_3_;
767
        }
768
769
        public boolean canSpawnMoreStructuresOfType(int p_75189_1_)
770
        {
771
            return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit;
772
        }
773
774
        public boolean canSpawnMoreStructures()
775
        {
776
            return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit;
777
        }
778
    }
779
780
    public static class PortalRoom extends StructureStrongholdPieces.Stronghold
781
    {
782
        private boolean hasSpawner;
783
784
        public PortalRoom()
785
        {
786
        }
787
788
        public PortalRoom(int p_i45577_1_, Random p_i45577_2_, StructureBoundingBox p_i45577_3_, EnumFacing p_i45577_4_)
789
        {
790
            super(p_i45577_1_);
791
            this.coordBaseMode = p_i45577_4_;
792
            this.boundingBox = p_i45577_3_;
793
        }
794
795
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
796
        {
797
            super.writeStructureToNBT(tagCompound);
798
            tagCompound.setBoolean("Mob", this.hasSpawner);
799
        }
800
801
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
802
        {
803
            super.readStructureFromNBT(tagCompound);
804
            this.hasSpawner = tagCompound.getBoolean("Mob");
805
        }
806
807
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
808
        {
809
            if (componentIn != null)
810
            {
811
                ((StructureStrongholdPieces.Stairs2)componentIn).strongholdPortalRoom = this;
812
            }
813
        }
814
815
        public static StructureStrongholdPieces.PortalRoom func_175865_a(List<StructureComponent> p_175865_0_, Random p_175865_1_, int p_175865_2_, int p_175865_3_, int p_175865_4_, EnumFacing p_175865_5_, int p_175865_6_)
816
        {
817
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175865_2_, p_175865_3_, p_175865_4_, -4, -1, 0, 11, 8, 16, p_175865_5_);
818
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175865_0_, structureboundingbox) == null ? new StructureStrongholdPieces.PortalRoom(p_175865_6_, p_175865_1_, structureboundingbox, p_175865_5_) : null;
819
        }
820
821
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
822
        {
823
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 10, 7, 15, false, randomIn, StructureStrongholdPieces.strongholdStones);
824
            this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.GRATES, 4, 1, 0);
825
            int i = 6;
826
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, i, 1, 1, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones);
827
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, i, 1, 9, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones);
828
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, i, 1, 8, i, 2, false, randomIn, StructureStrongholdPieces.strongholdStones);
829
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, i, 14, 8, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones);
830
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 2, 1, 4, false, randomIn, StructureStrongholdPieces.strongholdStones);
831
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, 1, 1, 9, 1, 4, false, randomIn, StructureStrongholdPieces.strongholdStones);
832
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 1, 1, 3, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false);
833
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 1, 9, 1, 3, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false);
834
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 1, 8, 7, 1, 12, false, randomIn, StructureStrongholdPieces.strongholdStones);
835
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 6, 1, 11, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false);
836
837
            for (int j = 3; j < 14; j += 2)
838
            {
839
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, j, 0, 4, j, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false);
840
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 3, j, 10, 4, j, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false);
841
            }
842
843
            for (int k1 = 2; k1 < 9; k1 += 2)
844
            {
845
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, k1, 3, 15, k1, 4, 15, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false);
846
            }
847
848
            int l1 = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 3);
849
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 5, 6, 1, 7, false, randomIn, StructureStrongholdPieces.strongholdStones);
850
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 2, 6, 6, 2, 7, false, randomIn, StructureStrongholdPieces.strongholdStones);
851
            this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 3, 7, 6, 3, 7, false, randomIn, StructureStrongholdPieces.strongholdStones);
852
853
            for (int k = 4; k <= 6; ++k)
854
            {
855
                this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 1, 4, structureBoundingBoxIn);
856
                this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 2, 5, structureBoundingBoxIn);
857
                this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 3, 6, structureBoundingBoxIn);
858
            }
859
860
            int i2 = EnumFacing.NORTH.getHorizontalIndex();
861
            int l = EnumFacing.SOUTH.getHorizontalIndex();
862
            int i1 = EnumFacing.EAST.getHorizontalIndex();
863
            int j1 = EnumFacing.WEST.getHorizontalIndex();
864
865
            if (this.coordBaseMode != null)
866
            {
867
                switch (this.coordBaseMode)
868
                {
869
                    case SOUTH:
870
                        i2 = EnumFacing.SOUTH.getHorizontalIndex();
871
                        l = EnumFacing.NORTH.getHorizontalIndex();
872
                        break;
873
874
                    case WEST:
875
                        i2 = EnumFacing.WEST.getHorizontalIndex();
876
                        l = EnumFacing.EAST.getHorizontalIndex();
877
                        i1 = EnumFacing.SOUTH.getHorizontalIndex();
878
                        j1 = EnumFacing.NORTH.getHorizontalIndex();
879
                        break;
880
881
                    case EAST:
882
                        i2 = EnumFacing.EAST.getHorizontalIndex();
883
                        l = EnumFacing.WEST.getHorizontalIndex();
884
                        i1 = EnumFacing.SOUTH.getHorizontalIndex();
885
                        j1 = EnumFacing.NORTH.getHorizontalIndex();
886
                }
887
            }
888
889
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 4, 3, 8, structureBoundingBoxIn);
890
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 5, 3, 8, structureBoundingBoxIn);
891
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 6, 3, 8, structureBoundingBoxIn);
892
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 4, 3, 12, structureBoundingBoxIn);
893
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 5, 3, 12, structureBoundingBoxIn);
894
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 6, 3, 12, structureBoundingBoxIn);
895
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 9, structureBoundingBoxIn);
896
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 10, structureBoundingBoxIn);
897
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 11, structureBoundingBoxIn);
898
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 9, structureBoundingBoxIn);
899
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 10, structureBoundingBoxIn);
900
            this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 11, structureBoundingBoxIn);
901
902
            if (!this.hasSpawner)
903
            {
904
                i = this.getYWithOffset(3);
905
                BlockPos blockpos = new BlockPos(this.getXWithOffset(5, 6), i, this.getZWithOffset(5, 6));
906
907
                if (structureBoundingBoxIn.isVecInside(blockpos))
908
                {
909
                    this.hasSpawner = true;
910
                    worldIn.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2);
911
                    TileEntity tileentity = worldIn.getTileEntity(blockpos);
912
913
                    if (tileentity instanceof TileEntityMobSpawner)
914
                    {
915
                        ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic().setEntityName("Silverfish");
916
                    }
917
                }
918
            }
919
920
            return true;
921
        }
922
    }
923
924
    public static class Prison extends StructureStrongholdPieces.Stronghold
925
    {
926
        public Prison()
927
        {
928
        }
929
930
        public Prison(int p_i45576_1_, Random p_i45576_2_, StructureBoundingBox p_i45576_3_, EnumFacing p_i45576_4_)
931
        {
932
            super(p_i45576_1_);
933
            this.coordBaseMode = p_i45576_4_;
934
            this.field_143013_d = this.getRandomDoor(p_i45576_2_);
935
            this.boundingBox = p_i45576_3_;
936
        }
937
938
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
939
        {
940
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
941
        }
942
943
        public static StructureStrongholdPieces.Prison func_175860_a(List<StructureComponent> p_175860_0_, Random p_175860_1_, int p_175860_2_, int p_175860_3_, int p_175860_4_, EnumFacing p_175860_5_, int p_175860_6_)
944
        {
945
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175860_2_, p_175860_3_, p_175860_4_, -1, -1, 0, 9, 5, 11, p_175860_5_);
946
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175860_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Prison(p_175860_6_, p_175860_1_, structureboundingbox, p_175860_5_) : null;
947
        }
948
949
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
950
        {
951
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
952
            {
953
                return false;
954
            }
955
            else
956
            {
957
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 8, 4, 10, true, randomIn, StructureStrongholdPieces.strongholdStones);
958
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
959
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 10, 3, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
960
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 1, false, randomIn, StructureStrongholdPieces.strongholdStones);
961
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 3, 4, 3, 3, false, randomIn, StructureStrongholdPieces.strongholdStones);
962
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 7, 4, 3, 7, false, randomIn, StructureStrongholdPieces.strongholdStones);
963
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 3, 9, false, randomIn, StructureStrongholdPieces.strongholdStones);
964
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 4, 4, 3, 6, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false);
965
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 5, 7, 3, 5, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false);
966
                this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 4, 3, 2, structureBoundingBoxIn);
967
                this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 4, 3, 8, structureBoundingBoxIn);
968
                this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 2, structureBoundingBoxIn);
969
                this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 2, structureBoundingBoxIn);
970
                this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 8, structureBoundingBoxIn);
971
                this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 8, structureBoundingBoxIn);
972
                return true;
973
            }
974
        }
975
    }
976
977
    public static class RightTurn extends StructureStrongholdPieces.LeftTurn
978
    {
979
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
980
        {
981
            if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
982
            {
983
                this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
984
            }
985
            else
986
            {
987
                this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
988
            }
989
        }
990
991
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
992
        {
993
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
994
            {
995
                return false;
996
            }
997
            else
998
            {
999
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.strongholdStones);
1000
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
1001
1002
                if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST)
1003
                {
1004
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1005
                }
1006
                else
1007
                {
1008
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1009
                }
1010
1011
                return true;
1012
            }
1013
        }
1014
    }
1015
1016
    public static class RoomCrossing extends StructureStrongholdPieces.Stronghold
1017
    {
1018
        private static final List<WeightedRandomChestContent> strongholdRoomCrossingChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)});
1019
        protected int roomType;
1020
1021
        public RoomCrossing()
1022
        {
1023
        }
1024
1025
        public RoomCrossing(int p_i45575_1_, Random p_i45575_2_, StructureBoundingBox p_i45575_3_, EnumFacing p_i45575_4_)
1026
        {
1027
            super(p_i45575_1_);
1028
            this.coordBaseMode = p_i45575_4_;
1029
            this.field_143013_d = this.getRandomDoor(p_i45575_2_);
1030
            this.boundingBox = p_i45575_3_;
1031
            this.roomType = p_i45575_2_.nextInt(5);
1032
        }
1033
1034
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
1035
        {
1036
            super.writeStructureToNBT(tagCompound);
1037
            tagCompound.setInteger("Type", this.roomType);
1038
        }
1039
1040
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
1041
        {
1042
            super.readStructureFromNBT(tagCompound);
1043
            this.roomType = tagCompound.getInteger("Type");
1044
        }
1045
1046
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
1047
        {
1048
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 4, 1);
1049
            this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 4);
1050
            this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 4);
1051
        }
1052
1053
        public static StructureStrongholdPieces.RoomCrossing func_175859_a(List<StructureComponent> p_175859_0_, Random p_175859_1_, int p_175859_2_, int p_175859_3_, int p_175859_4_, EnumFacing p_175859_5_, int p_175859_6_)
1054
        {
1055
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175859_2_, p_175859_3_, p_175859_4_, -4, -1, 0, 11, 7, 11, p_175859_5_);
1056
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175859_0_, structureboundingbox) == null ? new StructureStrongholdPieces.RoomCrossing(p_175859_6_, p_175859_1_, structureboundingbox, p_175859_5_) : null;
1057
        }
1058
1059
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
1060
        {
1061
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
1062
            {
1063
                return false;
1064
            }
1065
            else
1066
            {
1067
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 10, 6, 10, true, randomIn, StructureStrongholdPieces.strongholdStones);
1068
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 1, 0);
1069
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 6, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1070
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 4, 0, 3, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1071
                this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 1, 4, 10, 3, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1072
1073
                switch (this.roomType)
1074
                {
1075
                    case 0:
1076
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureBoundingBoxIn);
1077
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureBoundingBoxIn);
1078
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureBoundingBoxIn);
1079
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 4, 3, 5, structureBoundingBoxIn);
1080
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 6, 3, 5, structureBoundingBoxIn);
1081
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 4, structureBoundingBoxIn);
1082
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 6, structureBoundingBoxIn);
1083
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 4, structureBoundingBoxIn);
1084
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 5, structureBoundingBoxIn);
1085
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 6, structureBoundingBoxIn);
1086
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 4, structureBoundingBoxIn);
1087
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 5, structureBoundingBoxIn);
1088
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 6, structureBoundingBoxIn);
1089
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 5, 1, 4, structureBoundingBoxIn);
1090
                        this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 5, 1, 6, structureBoundingBoxIn);
1091
                        break;
1092
1093
                    case 1:
1094
                        for (int i1 = 0; i1 < 5; ++i1)
1095
                        {
1096
                            this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 1, 3 + i1, structureBoundingBoxIn);
1097
                            this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 7, 1, 3 + i1, structureBoundingBoxIn);
1098
                            this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 3, structureBoundingBoxIn);
1099
                            this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 7, structureBoundingBoxIn);
1100
                        }
1101
1102
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureBoundingBoxIn);
1103
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureBoundingBoxIn);
1104
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureBoundingBoxIn);
1105
                        this.setBlockState(worldIn, Blocks.flowing_water.getDefaultState(), 5, 4, 5, structureBoundingBoxIn);
1106
                        break;
1107
1108
                    case 2:
1109
                        for (int i = 1; i <= 9; ++i)
1110
                        {
1111
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 1, 3, i, structureBoundingBoxIn);
1112
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 9, 3, i, structureBoundingBoxIn);
1113
                        }
1114
1115
                        for (int j = 1; j <= 9; ++j)
1116
                        {
1117
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), j, 3, 1, structureBoundingBoxIn);
1118
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), j, 3, 9, structureBoundingBoxIn);
1119
                        }
1120
1121
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 1, 4, structureBoundingBoxIn);
1122
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 1, 6, structureBoundingBoxIn);
1123
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 3, 4, structureBoundingBoxIn);
1124
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 3, 6, structureBoundingBoxIn);
1125
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 1, 5, structureBoundingBoxIn);
1126
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 1, 5, structureBoundingBoxIn);
1127
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 3, 5, structureBoundingBoxIn);
1128
                        this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 3, 5, structureBoundingBoxIn);
1129
1130
                        for (int k = 1; k <= 3; ++k)
1131
                        {
1132
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, k, 4, structureBoundingBoxIn);
1133
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, k, 4, structureBoundingBoxIn);
1134
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, k, 6, structureBoundingBoxIn);
1135
                            this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, k, 6, structureBoundingBoxIn);
1136
                        }
1137
1138
                        this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 5, structureBoundingBoxIn);
1139
1140
                        for (int l = 2; l <= 8; ++l)
1141
                        {
1142
                            this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 2, 3, l, structureBoundingBoxIn);
1143
                            this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 3, l, structureBoundingBoxIn);
1144
1145
                            if (l <= 3 || l >= 7)
1146
                            {
1147
                                this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 4, 3, l, structureBoundingBoxIn);
1148
                                this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 5, 3, l, structureBoundingBoxIn);
1149
                                this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 6, 3, l, structureBoundingBoxIn);
1150
                            }
1151
1152
                            this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 7, 3, l, structureBoundingBoxIn);
1153
                            this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 3, l, structureBoundingBoxIn);
1154
                        }
1155
1156
                        this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 1, 3, structureBoundingBoxIn);
1157
                        this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 2, 3, structureBoundingBoxIn);
1158
                        this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 3, 3, structureBoundingBoxIn);
1159
                        this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 1 + randomIn.nextInt(4));
1160
                }
1161
1162
                return true;
1163
            }
1164
        }
1165
    }
1166
1167
    public static class Stairs extends StructureStrongholdPieces.Stronghold
1168
    {
1169
        private boolean field_75024_a;
1170
1171
        public Stairs()
1172
        {
1173
        }
1174
1175
        public Stairs(int p_i2081_1_, Random p_i2081_2_, int p_i2081_3_, int p_i2081_4_)
1176
        {
1177
            super(p_i2081_1_);
1178
            this.field_75024_a = true;
1179
            this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(p_i2081_2_);
1180
            this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING;
1181
1182
            switch (this.coordBaseMode)
1183
            {
1184
                case NORTH:
1185
                case SOUTH:
1186
                    this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1);
1187
                    break;
1188
1189
                default:
1190
                    this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1);
1191
            }
1192
        }
1193
1194
        public Stairs(int p_i45574_1_, Random p_i45574_2_, StructureBoundingBox p_i45574_3_, EnumFacing p_i45574_4_)
1195
        {
1196
            super(p_i45574_1_);
1197
            this.field_75024_a = false;
1198
            this.coordBaseMode = p_i45574_4_;
1199
            this.field_143013_d = this.getRandomDoor(p_i45574_2_);
1200
            this.boundingBox = p_i45574_3_;
1201
        }
1202
1203
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
1204
        {
1205
            super.writeStructureToNBT(tagCompound);
1206
            tagCompound.setBoolean("Source", this.field_75024_a);
1207
        }
1208
1209
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
1210
        {
1211
            super.readStructureFromNBT(tagCompound);
1212
            this.field_75024_a = tagCompound.getBoolean("Source");
1213
        }
1214
1215
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
1216
        {
1217
            if (this.field_75024_a)
1218
            {
1219
                StructureStrongholdPieces.strongComponentType = StructureStrongholdPieces.Crossing.class;
1220
            }
1221
1222
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
1223
        }
1224
1225
        public static StructureStrongholdPieces.Stairs func_175863_a(List<StructureComponent> p_175863_0_, Random p_175863_1_, int p_175863_2_, int p_175863_3_, int p_175863_4_, EnumFacing p_175863_5_, int p_175863_6_)
1226
        {
1227
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175863_2_, p_175863_3_, p_175863_4_, -1, -7, 0, 5, 11, 5, p_175863_5_);
1228
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175863_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Stairs(p_175863_6_, p_175863_1_, structureboundingbox, p_175863_5_) : null;
1229
        }
1230
1231
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
1232
        {
1233
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
1234
            {
1235
                return false;
1236
            }
1237
            else
1238
            {
1239
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 10, 4, true, randomIn, StructureStrongholdPieces.strongholdStones);
1240
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 7, 0);
1241
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 4);
1242
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 6, 1, structureBoundingBoxIn);
1243
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5, 1, structureBoundingBoxIn);
1244
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 6, 1, structureBoundingBoxIn);
1245
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5, 2, structureBoundingBoxIn);
1246
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 4, 3, structureBoundingBoxIn);
1247
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 5, 3, structureBoundingBoxIn);
1248
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 4, 3, structureBoundingBoxIn);
1249
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 3, 3, structureBoundingBoxIn);
1250
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 4, 3, structureBoundingBoxIn);
1251
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 3, 2, structureBoundingBoxIn);
1252
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 2, 1, structureBoundingBoxIn);
1253
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 3, 1, structureBoundingBoxIn);
1254
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 2, 1, structureBoundingBoxIn);
1255
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 1, 1, structureBoundingBoxIn);
1256
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 2, 1, structureBoundingBoxIn);
1257
                this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 1, 2, structureBoundingBoxIn);
1258
                this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 1, 3, structureBoundingBoxIn);
1259
                return true;
1260
            }
1261
        }
1262
    }
1263
1264
    public static class Stairs2 extends StructureStrongholdPieces.Stairs
1265
    {
1266
        public StructureStrongholdPieces.PieceWeight strongholdPieceWeight;
1267
        public StructureStrongholdPieces.PortalRoom strongholdPortalRoom;
1268
        public List<StructureComponent> field_75026_c = Lists.<StructureComponent>newArrayList();
1269
1270
        public Stairs2()
1271
        {
1272
        }
1273
1274
        public Stairs2(int p_i2083_1_, Random p_i2083_2_, int p_i2083_3_, int p_i2083_4_)
1275
        {
1276
            super(0, p_i2083_2_, p_i2083_3_, p_i2083_4_);
1277
        }
1278
1279
        public BlockPos getBoundingBoxCenter()
1280
        {
1281
            return this.strongholdPortalRoom != null ? this.strongholdPortalRoom.getBoundingBoxCenter() : super.getBoundingBoxCenter();
1282
        }
1283
    }
1284
1285
    public static class StairsStraight extends StructureStrongholdPieces.Stronghold
1286
    {
1287
        public StairsStraight()
1288
        {
1289
        }
1290
1291
        public StairsStraight(int p_i45572_1_, Random p_i45572_2_, StructureBoundingBox p_i45572_3_, EnumFacing p_i45572_4_)
1292
        {
1293
            super(p_i45572_1_);
1294
            this.coordBaseMode = p_i45572_4_;
1295
            this.field_143013_d = this.getRandomDoor(p_i45572_2_);
1296
            this.boundingBox = p_i45572_3_;
1297
        }
1298
1299
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
1300
        {
1301
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
1302
        }
1303
1304
        public static StructureStrongholdPieces.StairsStraight func_175861_a(List<StructureComponent> p_175861_0_, Random p_175861_1_, int p_175861_2_, int p_175861_3_, int p_175861_4_, EnumFacing p_175861_5_, int p_175861_6_)
1305
        {
1306
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175861_2_, p_175861_3_, p_175861_4_, -1, -7, 0, 5, 11, 8, p_175861_5_);
1307
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175861_0_, structureboundingbox) == null ? new StructureStrongholdPieces.StairsStraight(p_175861_6_, p_175861_1_, structureboundingbox, p_175861_5_) : null;
1308
        }
1309
1310
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
1311
        {
1312
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
1313
            {
1314
                return false;
1315
            }
1316
            else
1317
            {
1318
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 10, 7, true, randomIn, StructureStrongholdPieces.strongholdStones);
1319
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 7, 0);
1320
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 7);
1321
                int i = this.getMetadataWithOffset(Blocks.stone_stairs, 2);
1322
1323
                for (int j = 0; j < 6; ++j)
1324
                {
1325
                    this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 1, 6 - j, 1 + j, structureBoundingBoxIn);
1326
                    this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 2, 6 - j, 1 + j, structureBoundingBoxIn);
1327
                    this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 3, 6 - j, 1 + j, structureBoundingBoxIn);
1328
1329
                    if (j < 5)
1330
                    {
1331
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5 - j, 1 + j, structureBoundingBoxIn);
1332
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 5 - j, 1 + j, structureBoundingBoxIn);
1333
                        this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 5 - j, 1 + j, structureBoundingBoxIn);
1334
                    }
1335
                }
1336
1337
                return true;
1338
            }
1339
        }
1340
    }
1341
1342
    static class Stones extends StructureComponent.BlockSelector
1343
    {
1344
        private Stones()
1345
        {
1346
        }
1347
1348
        public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
1349
        {
1350
            if (p_75062_5_)
1351
            {
1352
                float f = rand.nextFloat();
1353
1354
                if (f < 0.2F)
1355
                {
1356
                    this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CRACKED_META);
1357
                }
1358
                else if (f < 0.5F)
1359
                {
1360
                    this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.MOSSY_META);
1361
                }
1362
                else if (f < 0.55F)
1363
                {
1364
                    this.blockstate = Blocks.monster_egg.getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata());
1365
                }
1366
                else
1367
                {
1368
                    this.blockstate = Blocks.stonebrick.getDefaultState();
1369
                }
1370
            }
1371
            else
1372
            {
1373
                this.blockstate = Blocks.air.getDefaultState();
1374
            }
1375
        }
1376
    }
1377
1378
    public static class Straight extends StructureStrongholdPieces.Stronghold
1379
    {
1380
        private boolean expandsX;
1381
        private boolean expandsZ;
1382
1383
        public Straight()
1384
        {
1385
        }
1386
1387
        public Straight(int p_i45573_1_, Random p_i45573_2_, StructureBoundingBox p_i45573_3_, EnumFacing p_i45573_4_)
1388
        {
1389
            super(p_i45573_1_);
1390
            this.coordBaseMode = p_i45573_4_;
1391
            this.field_143013_d = this.getRandomDoor(p_i45573_2_);
1392
            this.boundingBox = p_i45573_3_;
1393
            this.expandsX = p_i45573_2_.nextInt(2) == 0;
1394
            this.expandsZ = p_i45573_2_.nextInt(2) == 0;
1395
        }
1396
1397
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
1398
        {
1399
            super.writeStructureToNBT(tagCompound);
1400
            tagCompound.setBoolean("Left", this.expandsX);
1401
            tagCompound.setBoolean("Right", this.expandsZ);
1402
        }
1403
1404
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
1405
        {
1406
            super.readStructureFromNBT(tagCompound);
1407
            this.expandsX = tagCompound.getBoolean("Left");
1408
            this.expandsZ = tagCompound.getBoolean("Right");
1409
        }
1410
1411
        public void buildComponent(StructureComponent componentIn, List<StructureComponent> listIn, Random rand)
1412
        {
1413
            this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1);
1414
1415
            if (this.expandsX)
1416
            {
1417
                this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 2);
1418
            }
1419
1420
            if (this.expandsZ)
1421
            {
1422
                this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 2);
1423
            }
1424
        }
1425
1426
        public static StructureStrongholdPieces.Straight func_175862_a(List<StructureComponent> p_175862_0_, Random p_175862_1_, int p_175862_2_, int p_175862_3_, int p_175862_4_, EnumFacing p_175862_5_, int p_175862_6_)
1427
        {
1428
            StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175862_2_, p_175862_3_, p_175862_4_, -1, -1, 0, 5, 5, 7, p_175862_5_);
1429
            return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175862_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Straight(p_175862_6_, p_175862_1_, structureboundingbox, p_175862_5_) : null;
1430
        }
1431
1432
        public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
1433
        {
1434
            if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
1435
            {
1436
                return false;
1437
            }
1438
            else
1439
            {
1440
                this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.strongholdStones);
1441
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
1442
                this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6);
1443
                this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.torch.getDefaultState());
1444
                this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.torch.getDefaultState());
1445
                this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.torch.getDefaultState());
1446
                this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.torch.getDefaultState());
1447
1448
                if (this.expandsX)
1449
                {
1450
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 2, 0, 3, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1451
                }
1452
1453
                if (this.expandsZ)
1454
                {
1455
                    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 2, 4, 3, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1456
                }
1457
1458
                return true;
1459
            }
1460
        }
1461
    }
1462
1463
    abstract static class Stronghold extends StructureComponent
1464
    {
1465
        protected StructureStrongholdPieces.Stronghold.Door field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING;
1466
1467
        public Stronghold()
1468
        {
1469
        }
1470
1471
        protected Stronghold(int p_i2087_1_)
1472
        {
1473
            super(p_i2087_1_);
1474
        }
1475
1476
        protected void writeStructureToNBT(NBTTagCompound tagCompound)
1477
        {
1478
            tagCompound.setString("EntryDoor", this.field_143013_d.name());
1479
        }
1480
1481
        protected void readStructureFromNBT(NBTTagCompound tagCompound)
1482
        {
1483
            this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.valueOf(tagCompound.getString("EntryDoor"));
1484
        }
1485
1486
        protected void placeDoor(World worldIn, Random p_74990_2_, StructureBoundingBox p_74990_3_, StructureStrongholdPieces.Stronghold.Door p_74990_4_, int p_74990_5_, int p_74990_6_, int p_74990_7_)
1487
        {
1488
            switch (p_74990_4_)
1489
            {
1490
                case OPENING:
1491
                default:
1492
                    this.fillWithBlocks(worldIn, p_74990_3_, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_5_ + 3 - 1, p_74990_6_ + 3 - 1, p_74990_7_, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
1493
                    break;
1494
1495
                case WOOD_DOOR:
1496
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_);
1497
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1498
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1499
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1500
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1501
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1502
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_);
1503
                    this.setBlockState(worldIn, Blocks.oak_door.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_);
1504
                    this.setBlockState(worldIn, Blocks.oak_door.getStateFromMeta(8), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1505
                    break;
1506
1507
                case GRATES:
1508
                    this.setBlockState(worldIn, Blocks.air.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_);
1509
                    this.setBlockState(worldIn, Blocks.air.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1510
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_);
1511
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1512
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1513
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1514
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1515
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1516
                    this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_);
1517
                    break;
1518
1519
                case IRON_DOOR:
1520
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_);
1521
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1522
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1523
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1524
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_);
1525
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1526
                    this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_);
1527
                    this.setBlockState(worldIn, Blocks.iron_door.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_);
1528
                    this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(8), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_);
1529
                    this.setBlockState(worldIn, Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 4)), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ + 1, p_74990_3_);
1530
                    this.setBlockState(worldIn, Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 3)), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ - 1, p_74990_3_);
1531
            }
1532
        }
1533
1534
        protected StructureStrongholdPieces.Stronghold.Door getRandomDoor(Random p_74988_1_)
1535
        {
1536
            int i = p_74988_1_.nextInt(5);
1537
1538
            switch (i)
1539
            {
1540
                case 0:
1541
                case 1:
1542
                default:
1543
                    return StructureStrongholdPieces.Stronghold.Door.OPENING;
1544
1545
                case 2:
1546
                    return StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR;
1547
1548
                case 3:
1549
                    return StructureStrongholdPieces.Stronghold.Door.GRATES;
1550
1551
                case 4:
1552
                    return StructureStrongholdPieces.Stronghold.Door.IRON_DOOR;
1553
            }
1554
        }
1555
1556
        protected StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 p_74986_1_, List<StructureComponent> p_74986_2_, Random p_74986_3_, int p_74986_4_, int p_74986_5_)
1557
        {
1558
            if (this.coordBaseMode != null)
1559
            {
1560
                switch (this.coordBaseMode)
1561
                {
1562
                    case NORTH:
1563
                        return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType());
1564
1565
                    case SOUTH:
1566
                        return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType());
1567
1568
                    case WEST:
1569
                        return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType());
1570
1571
                    case EAST:
1572
                        return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType());
1573
                }
1574
            }
1575
1576
            return null;
1577
        }
1578
1579
        protected StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 p_74989_1_, List<StructureComponent> p_74989_2_, Random p_74989_3_, int p_74989_4_, int p_74989_5_)
1580
        {
1581
            if (this.coordBaseMode != null)
1582
            {
1583
                switch (this.coordBaseMode)
1584
                {
1585
                    case NORTH:
1586
                        return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, EnumFacing.WEST, this.getComponentType());
1587
1588
                    case SOUTH:
1589
                        return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, EnumFacing.WEST, this.getComponentType());
1590
1591
                    case WEST:
1592
                        return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType());
1593
1594
                    case EAST:
1595
                        return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType());
1596
                }
1597
            }
1598
1599
            return null;
1600
        }
1601
1602
        protected StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 p_74987_1_, List<StructureComponent> p_74987_2_, Random p_74987_3_, int p_74987_4_, int p_74987_5_)
1603
        {
1604
            if (this.coordBaseMode != null)
1605
            {
1606
                switch (this.coordBaseMode)
1607
                {
1608
                    case NORTH:
1609
                        return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, EnumFacing.EAST, this.getComponentType());
1610
1611
                    case SOUTH:
1612
                        return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, EnumFacing.EAST, this.getComponentType());
1613
1614
                    case WEST:
1615
                        return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType());
1616
1617
                    case EAST:
1618
                        return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType());
1619
                }
1620
            }
1621
1622
            return null;
1623
        }
1624
1625
        protected static boolean canStrongholdGoDeeper(StructureBoundingBox p_74991_0_)
1626
        {
1627
            return p_74991_0_ != null && p_74991_0_.minY > 10;
1628
        }
1629
1630
        public static enum Door
1631
        {
1632
            OPENING,
1633
            WOOD_DOOR,
1634
            GRATES,
1635
            IRON_DOOR;
1636
        }
1637
    }
1638
}
1639

Deobfuscated MCP 1.8.9 source of StructureStrongholdPieces from Marcelektro/MavenMCP-1.8.9 (net/minecraft/world/gen/structure/StructureStrongholdPieces.java), stored verbatim.