| 1 | package net.minecraft.world.gen.layer;
|
| 2 |
|
| 3 | import net.minecraft.world.biome.BiomeGenBase;
|
| 4 |
|
| 5 | public class GenLayerRiverMix extends GenLayer
|
| 6 | {
|
| 7 | private GenLayer biomePatternGeneratorChain;
|
| 8 | private GenLayer riverPatternGeneratorChain;
|
| 9 |
|
| 10 | public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_)
|
| 11 | {
|
| 12 | super(p_i2129_1_);
|
| 13 | this.biomePatternGeneratorChain = p_i2129_3_;
|
| 14 | this.riverPatternGeneratorChain = p_i2129_4_;
|
| 15 | }
|
| 16 |
|
| 17 | /**
|
| 18 | * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an
|
| 19 | * argument).
|
| 20 | */
|
| 21 | public void initWorldGenSeed(long seed)
|
| 22 | {
|
| 23 | this.biomePatternGeneratorChain.initWorldGenSeed(seed);
|
| 24 | this.riverPatternGeneratorChain.initWorldGenSeed(seed);
|
| 25 | super.initWorldGenSeed(seed);
|
| 26 | }
|
| 27 |
|
| 28 | /**
|
| 29 | * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
|
| 30 | * amounts, or biomeList[] indices based on the particular GenLayer subclass.
|
| 31 | */
|
| 32 | public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
|
| 33 | {
|
| 34 | int[] aint = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight);
|
| 35 | int[] aint1 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight);
|
| 36 | int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight);
|
| 37 |
|
| 38 | for (int i = 0; i < areaWidth * areaHeight; ++i)
|
| 39 | {
|
| 40 | if (aint[i] != BiomeGenBase.ocean.biomeID && aint[i] != BiomeGenBase.deepOcean.biomeID)
|
| 41 | {
|
| 42 | if (aint1[i] == BiomeGenBase.river.biomeID)
|
| 43 | {
|
| 44 | if (aint[i] == BiomeGenBase.icePlains.biomeID)
|
| 45 | {
|
| 46 | aint2[i] = BiomeGenBase.frozenRiver.biomeID;
|
| 47 | }
|
| 48 | else if (aint[i] != BiomeGenBase.mushroomIsland.biomeID && aint[i] != BiomeGenBase.mushroomIslandShore.biomeID)
|
| 49 | {
|
| 50 | aint2[i] = aint1[i] & 255;
|
| 51 | }
|
| 52 | else
|
| 53 | {
|
| 54 | aint2[i] = BiomeGenBase.mushroomIslandShore.biomeID;
|
| 55 | }
|
| 56 | }
|
| 57 | else
|
| 58 | {
|
| 59 | aint2[i] = aint[i];
|
| 60 | }
|
| 61 | }
|
| 62 | else
|
| 63 | {
|
| 64 | aint2[i] = aint[i];
|
| 65 | }
|
| 66 | }
|
| 67 |
|
| 68 | return aint2;
|
| 69 | }
|
| 70 | }
|
| 71 |
|