| 1 | package net.minecraft.world.gen.layer;
|
| 2 |
|
| 3 | import net.minecraft.world.biome.BiomeGenBase;
|
| 4 | import net.minecraft.world.biome.BiomeGenJungle;
|
| 5 | import net.minecraft.world.biome.BiomeGenMesa;
|
| 6 |
|
| 7 | public class GenLayerShore extends GenLayer
|
| 8 | {
|
| 9 | public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_)
|
| 10 | {
|
| 11 | super(p_i2130_1_);
|
| 12 | this.parent = p_i2130_3_;
|
| 13 | }
|
| 14 |
|
| 15 | /**
|
| 16 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
|
| 17 | * amounts, or biomeList[] indices based on the particular GenLayer subclass.
|
| 18 | */
|
| 19 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
|
| 20 | {
|
| 21 | int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
|
| 22 | int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
|
| 23 |
|
| 24 | for (int i = 0; i < areaHeight; ++i)
|
| 25 | {
|
| 26 | for (int j = 0; j < areaWidth; ++j)
|
| 27 | {
|
| 28 | this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
|
| 29 | int k = aint[j + 1 + (i + 1) * (areaWidth + 2)];
|
| 30 | BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k);
|
| 31 |
|
| 32 | if (k == BiomeGenBase.mushroomIsland.biomeID)
|
| 33 | {
|
| 34 | int j2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
|
| 35 | int i3 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
|
| 36 | int l3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
|
| 37 | int k4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
|
| 38 |
|
| 39 | if (j2 != BiomeGenBase.ocean.biomeID && i3 != BiomeGenBase.ocean.biomeID && l3 != BiomeGenBase.ocean.biomeID && k4 != BiomeGenBase.ocean.biomeID)
|
| 40 | {
|
| 41 | aint1[j + i * areaWidth] = k;
|
| 42 | }
|
| 43 | else
|
| 44 | {
|
| 45 | aint1[j + i * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID;
|
| 46 | }
|
| 47 | }
|
| 48 | else if (biomegenbase != null && biomegenbase.getBiomeClass() == BiomeGenJungle.class)
|
| 49 | {
|
| 50 | int i2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
|
| 51 | int l2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
|
| 52 | int k3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
|
| 53 | int j4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
|
| 54 |
|
| 55 | if (this.func_151631_c(i2) && this.func_151631_c(l2) && this.func_151631_c(k3) && this.func_151631_c(j4))
|
| 56 | {
|
| 57 | if (!isBiomeOceanic(i2) && !isBiomeOceanic(l2) && !isBiomeOceanic(k3) && !isBiomeOceanic(j4))
|
| 58 | {
|
| 59 | aint1[j + i * areaWidth] = k;
|
| 60 | }
|
| 61 | else
|
| 62 | {
|
| 63 | aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
|
| 64 | }
|
| 65 | }
|
| 66 | else
|
| 67 | {
|
| 68 | aint1[j + i * areaWidth] = BiomeGenBase.jungleEdge.biomeID;
|
| 69 | }
|
| 70 | }
|
| 71 | else if (k != BiomeGenBase.extremeHills.biomeID && k != BiomeGenBase.extremeHillsPlus.biomeID && k != BiomeGenBase.extremeHillsEdge.biomeID)
|
| 72 | {
|
| 73 | if (biomegenbase != null && biomegenbase.isSnowyBiome())
|
| 74 | {
|
| 75 | this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.coldBeach.biomeID);
|
| 76 | }
|
| 77 | else if (k != BiomeGenBase.mesa.biomeID && k != BiomeGenBase.mesaPlateau_F.biomeID)
|
| 78 | {
|
| 79 | if (k != BiomeGenBase.ocean.biomeID && k != BiomeGenBase.deepOcean.biomeID && k != BiomeGenBase.river.biomeID && k != BiomeGenBase.swampland.biomeID)
|
| 80 | {
|
| 81 | int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
|
| 82 | int k2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
|
| 83 | int j3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
|
| 84 | int i4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
|
| 85 |
|
| 86 | if (!isBiomeOceanic(l1) && !isBiomeOceanic(k2) && !isBiomeOceanic(j3) && !isBiomeOceanic(i4))
|
| 87 | {
|
| 88 | aint1[j + i * areaWidth] = k;
|
| 89 | }
|
| 90 | else
|
| 91 | {
|
| 92 | aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
|
| 93 | }
|
| 94 | }
|
| 95 | else
|
| 96 | {
|
| 97 | aint1[j + i * areaWidth] = k;
|
| 98 | }
|
| 99 | }
|
| 100 | else
|
| 101 | {
|
| 102 | int l = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
|
| 103 | int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
|
| 104 | int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
|
| 105 | int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
|
| 106 |
|
| 107 | if (!isBiomeOceanic(l) && !isBiomeOceanic(i1) && !isBiomeOceanic(j1) && !isBiomeOceanic(k1))
|
| 108 | {
|
| 109 | if (this.func_151633_d(l) && this.func_151633_d(i1) && this.func_151633_d(j1) && this.func_151633_d(k1))
|
| 110 | {
|
| 111 | aint1[j + i * areaWidth] = k;
|
| 112 | }
|
| 113 | else
|
| 114 | {
|
| 115 | aint1[j + i * areaWidth] = BiomeGenBase.desert.biomeID;
|
| 116 | }
|
| 117 | }
|
| 118 | else
|
| 119 | {
|
| 120 | aint1[j + i * areaWidth] = k;
|
| 121 | }
|
| 122 | }
|
| 123 | }
|
| 124 | else
|
| 125 | {
|
| 126 | this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.stoneBeach.biomeID);
|
| 127 | }
|
| 128 | }
|
| 129 | }
|
| 130 |
|
| 131 | return aint1;
|
| 132 | }
|
| 133 |
|
| 134 | private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_)
|
| 135 | {
|
| 136 | if (isBiomeOceanic(p_151632_6_))
|
| 137 | {
|
| 138 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_;
|
| 139 | }
|
| 140 | else
|
| 141 | {
|
| 142 | int i = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)];
|
| 143 | int j = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)];
|
| 144 | int k = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)];
|
| 145 | int l = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)];
|
| 146 |
|
| 147 | if (!isBiomeOceanic(i) && !isBiomeOceanic(j) && !isBiomeOceanic(k) && !isBiomeOceanic(l))
|
| 148 | {
|
| 149 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_;
|
| 150 | }
|
| 151 | else
|
| 152 | {
|
| 153 | p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_;
|
| 154 | }
|
| 155 | }
|
| 156 | }
|
| 157 |
|
| 158 | private boolean func_151631_c(int p_151631_1_)
|
| 159 | {
|
| 160 | return BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).getBiomeClass() == BiomeGenJungle.class ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_);
|
| 161 | }
|
| 162 |
|
| 163 | private boolean func_151633_d(int p_151633_1_)
|
| 164 | {
|
| 165 | return BiomeGenBase.getBiome(p_151633_1_) instanceof BiomeGenMesa;
|
| 166 | }
|
| 167 | }
|
| 168 |
|