| 1 | package net.minecraft.world.gen.layer;
|
| 2 |
|
| 3 | import net.minecraft.world.WorldType;
|
| 4 | import net.minecraft.world.biome.BiomeGenBase;
|
| 5 | import net.minecraft.world.gen.ChunkProviderSettings;
|
| 6 |
|
| 7 | public class GenLayerBiome extends GenLayer
|
| 8 | {
|
| 9 | private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains};
|
| 10 | private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland};
|
| 11 | private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains};
|
| 12 | private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga};
|
| 13 | private final ChunkProviderSettings field_175973_g;
|
| 14 |
|
| 15 | public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_)
|
| 16 | {
|
| 17 | super(p_i45560_1_);
|
| 18 | this.parent = p_i45560_3_;
|
| 19 |
|
| 20 | if (p_i45560_4_ == WorldType.DEFAULT_1_1)
|
| 21 | {
|
| 22 | this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
|
| 23 | this.field_175973_g = null;
|
| 24 | }
|
| 25 | else if (p_i45560_4_ == WorldType.CUSTOMIZED)
|
| 26 | {
|
| 27 | this.field_175973_g = ChunkProviderSettings.Factory.jsonToFactory(p_i45560_5_).func_177864_b();
|
| 28 | }
|
| 29 | else
|
| 30 | {
|
| 31 | this.field_175973_g = null;
|
| 32 | }
|
| 33 | }
|
| 34 |
|
| 35 | /**
|
| 36 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
|
| 37 | * amounts, or biomeList[] indices based on the particular GenLayer subclass.
|
| 38 | */
|
| 39 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
|
| 40 | {
|
| 41 | int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);
|
| 42 | int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
|
| 43 |
|
| 44 | for (int i = 0; i < areaHeight; ++i)
|
| 45 | {
|
| 46 | for (int j = 0; j < areaWidth; ++j)
|
| 47 | {
|
| 48 | this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
|
| 49 | int k = aint[j + i * areaWidth];
|
| 50 | int l = (k & 3840) >> 8;
|
| 51 | k = k & -3841;
|
| 52 |
|
| 53 | if (this.field_175973_g != null && this.field_175973_g.fixedBiome >= 0)
|
| 54 | {
|
| 55 | aint1[j + i * areaWidth] = this.field_175973_g.fixedBiome;
|
| 56 | }
|
| 57 | else if (isBiomeOceanic(k))
|
| 58 | {
|
| 59 | aint1[j + i * areaWidth] = k;
|
| 60 | }
|
| 61 | else if (k == BiomeGenBase.mushroomIsland.biomeID)
|
| 62 | {
|
| 63 | aint1[j + i * areaWidth] = k;
|
| 64 | }
|
| 65 | else if (k == 1)
|
| 66 | {
|
| 67 | if (l > 0)
|
| 68 | {
|
| 69 | if (this.nextInt(3) == 0)
|
| 70 | {
|
| 71 | aint1[j + i * areaWidth] = BiomeGenBase.mesaPlateau.biomeID;
|
| 72 | }
|
| 73 | else
|
| 74 | {
|
| 75 | aint1[j + i * areaWidth] = BiomeGenBase.mesaPlateau_F.biomeID;
|
| 76 | }
|
| 77 | }
|
| 78 | else
|
| 79 | {
|
| 80 | aint1[j + i * areaWidth] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID;
|
| 81 | }
|
| 82 | }
|
| 83 | else if (k == 2)
|
| 84 | {
|
| 85 | if (l > 0)
|
| 86 | {
|
| 87 | aint1[j + i * areaWidth] = BiomeGenBase.jungle.biomeID;
|
| 88 | }
|
| 89 | else
|
| 90 | {
|
| 91 | aint1[j + i * areaWidth] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID;
|
| 92 | }
|
| 93 | }
|
| 94 | else if (k == 3)
|
| 95 | {
|
| 96 | if (l > 0)
|
| 97 | {
|
| 98 | aint1[j + i * areaWidth] = BiomeGenBase.megaTaiga.biomeID;
|
| 99 | }
|
| 100 | else
|
| 101 | {
|
| 102 | aint1[j + i * areaWidth] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID;
|
| 103 | }
|
| 104 | }
|
| 105 | else if (k == 4)
|
| 106 | {
|
| 107 | aint1[j + i * areaWidth] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID;
|
| 108 | }
|
| 109 | else
|
| 110 | {
|
| 111 | aint1[j + i * areaWidth] = BiomeGenBase.mushroomIsland.biomeID;
|
| 112 | }
|
| 113 | }
|
| 114 | }
|
| 115 |
|
| 116 | return aint1;
|
| 117 | }
|
| 118 | }
|
| 119 |
|