    001package net.minecraft.world.gen.layer;
    002
    003import net.minecraft.world.biome.BiomeGenBase;
    004
    005public class GenLayerShore extends GenLayer
    006{
    007    public GenLayerShore(long par1, GenLayer par3GenLayer)
    008    {
    009        super(par1);
    010        this.parent = par3GenLayer;
    011    }
    012
    013    /**
    014     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
    015     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
    016     */
    017    public int[] getInts(int par1, int par2, int par3, int par4)
    018    {
    019        int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
    020        int[] var6 = IntCache.getIntCache(par3 * par4);
    021
    022        for (int var7 = 0; var7 < par4; ++var7)
    023        {
    024            for (int var8 = 0; var8 < par3; ++var8)
    025            {
    026                this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
    027                int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)];
    028                int var10;
    029                int var11;
    030                int var12;
    031                int var13;
    032
    033                if (var9 == BiomeGenBase.mushroomIsland.biomeID)
    034                {
    035                    var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
    036                    var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
    037                    var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
    038                    var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
    039
    040                    if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID)
    041                    {
    042                        var6[var8 + var7 * par3] = var9;
    043                    }
    044                    else
    045                    {
    046                        var6[var8 + var7 * par3] = BiomeGenBase.mushroomIslandShore.biomeID;
    047                    }
    048                }
    049                else if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID)
    050                {
    051                    var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
    052                    var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
    053                    var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
    054                    var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
    055
    056                    if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID)
    057                    {
    058                        var6[var8 + var7 * par3] = var9;
    059                    }
    060                    else
    061                    {
    062                        var6[var8 + var7 * par3] = BiomeGenBase.beach.biomeID;
    063                    }
    064                }
    065                else if (var9 == BiomeGenBase.extremeHills.biomeID)
    066                {
    067                    var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
    068                    var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
    069                    var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
    070                    var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
    071
    072                    if (var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID)
    073                    {
    074                        var6[var8 + var7 * par3] = var9;
    075                    }
    076                    else
    077                    {
    078                        var6[var8 + var7 * par3] = BiomeGenBase.extremeHillsEdge.biomeID;
    079                    }
    080                }
    081                else
    082                {
    083                    var6[var8 + var7 * par3] = var9;
    084                }
    085            }
    086        }
    087
    088        return var6;
    089    }
    090}