    001package net.minecraft.world.gen.layer;
    002
    003import net.minecraft.world.biome.BiomeGenBase;
    004
    005public class GenLayerRiverMix extends GenLayer
    006{
    007    private GenLayer biomePatternGeneratorChain;
    008    private GenLayer riverPatternGeneratorChain;
    009
    010    public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer)
    011    {
    012        super(par1);
    013        this.biomePatternGeneratorChain = par3GenLayer;
    014        this.riverPatternGeneratorChain = par4GenLayer;
    015    }
    016
    017    /**
    018     * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an
    019     * argument).
    020     */
    021    public void initWorldGenSeed(long par1)
    022    {
    023        this.biomePatternGeneratorChain.initWorldGenSeed(par1);
    024        this.riverPatternGeneratorChain.initWorldGenSeed(par1);
    025        super.initWorldGenSeed(par1);
    026    }
    027
    028    /**
    029     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
    030     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
    031     */
    032    public int[] getInts(int par1, int par2, int par3, int par4)
    033    {
    034        int[] var5 = this.biomePatternGeneratorChain.getInts(par1, par2, par3, par4);
    035        int[] var6 = this.riverPatternGeneratorChain.getInts(par1, par2, par3, par4);
    036        int[] var7 = IntCache.getIntCache(par3 * par4);
    037
    038        for (int var8 = 0; var8 < par3 * par4; ++var8)
    039        {
    040            if (var5[var8] == BiomeGenBase.ocean.biomeID)
    041            {
    042                var7[var8] = var5[var8];
    043            }
    044            else if (var6[var8] >= 0)
    045            {
    046                if (var5[var8] == BiomeGenBase.icePlains.biomeID)
    047                {
    048                    var7[var8] = BiomeGenBase.frozenRiver.biomeID;
    049                }
    050                else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID)
    051                {
    052                    var7[var8] = var6[var8];
    053                }
    054                else
    055                {
    056                    var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID;
    057                }
    058            }
    059            else
    060            {
    061                var7[var8] = var5[var8];
    062            }
    063        }
    064
    065        return var7;
    066    }
    067}