| 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.entity.monster.EntityBlaze;
|
| 7 | import net.minecraft.entity.monster.EntityMagmaCube;
|
| 8 | import net.minecraft.entity.monster.EntityPigZombie;
|
| 9 | import net.minecraft.entity.monster.EntitySkeleton;
|
| 10 | import net.minecraft.world.World;
|
| 11 | import net.minecraft.world.biome.BiomeGenBase;
|
| 12 |
|
| 13 | public class MapGenNetherBridge extends MapGenStructure
|
| 14 | {
|
| 15 | private List<BiomeGenBase.SpawnListEntry> spawnList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
|
| 16 |
|
| 17 | public MapGenNetherBridge()
|
| 18 | {
|
| 19 | this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3));
|
| 20 | this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4));
|
| 21 | this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4));
|
| 22 | this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4));
|
| 23 | }
|
| 24 |
|
| 25 | public String getStructureName()
|
| 26 | {
|
| 27 | return "Fortress";
|
| 28 | }
|
| 29 |
|
| 30 | public List<BiomeGenBase.SpawnListEntry> getSpawnList()
|
| 31 | {
|
| 32 | return this.spawnList;
|
| 33 | }
|
| 34 |
|
| 35 | protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ)
|
| 36 | {
|
| 37 | int i = chunkX >> 4;
|
| 38 | int j = chunkZ >> 4;
|
| 39 | this.rand.setSeed((long)(i ^ j << 4) ^ this.worldObj.getSeed());
|
| 40 | this.rand.nextInt();
|
| 41 | return this.rand.nextInt(3) != 0 ? false : (chunkX != (i << 4) + 4 + this.rand.nextInt(8) ? false : chunkZ == (j << 4) + 4 + this.rand.nextInt(8));
|
| 42 | }
|
| 43 |
|
| 44 | protected StructureStart getStructureStart(int chunkX, int chunkZ)
|
| 45 | {
|
| 46 | return new MapGenNetherBridge.Start(this.worldObj, this.rand, chunkX, chunkZ);
|
| 47 | }
|
| 48 |
|
| 49 | public static class Start extends StructureStart
|
| 50 | {
|
| 51 | public Start()
|
| 52 | {
|
| 53 | }
|
| 54 |
|
| 55 | public Start(World worldIn, Random p_i2040_2_, int p_i2040_3_, int p_i2040_4_)
|
| 56 | {
|
| 57 | super(p_i2040_3_, p_i2040_4_);
|
| 58 | StructureNetherBridgePieces.Start structurenetherbridgepieces$start = new StructureNetherBridgePieces.Start(p_i2040_2_, (p_i2040_3_ << 4) + 2, (p_i2040_4_ << 4) + 2);
|
| 59 | this.components.add(structurenetherbridgepieces$start);
|
| 60 | structurenetherbridgepieces$start.buildComponent(structurenetherbridgepieces$start, this.components, p_i2040_2_);
|
| 61 | List<StructureComponent> list = structurenetherbridgepieces$start.field_74967_d;
|
| 62 |
|
| 63 | while (!list.isEmpty())
|
| 64 | {
|
| 65 | int i = p_i2040_2_.nextInt(list.size());
|
| 66 | StructureComponent structurecomponent = (StructureComponent)list.remove(i);
|
| 67 | structurecomponent.buildComponent(structurenetherbridgepieces$start, this.components, p_i2040_2_);
|
| 68 | }
|
| 69 |
|
| 70 | this.updateBoundingBox();
|
| 71 | this.setRandomHeight(worldIn, p_i2040_2_, 48, 70);
|
| 72 | }
|
| 73 | }
|
| 74 | }
|
| 75 |
|