コード例 #1
0
ファイル: WorldChunkManager.cs プロジェクト: iFlyingfish/MCX
    /**
     * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
     */
    public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
    {
        IntCache.resetIntCache();

        if (listToReuse == null || listToReuse.Length < width * length)
        {
            listToReuse = new float[width * length];
        }

        int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);

        for (int i = 0; i < width * length; ++i)
        {
            float f = (float)BiomeGenBase.getBiomeFromBiomeList(aint [i], BiomeGenBase.field_180279_ad).getIntRainfall() / 65536.0F;

            if (f > 1.0F)
            {
                f = 1.0F;
            }

            listToReuse [i] = f;
        }

        return(listToReuse);
    }