Пример #1
0
        /**
         * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
         * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
         */
        public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, bool par6)
        {
            IntCache.resetIntCache();

            if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.Length < par4 * par5)
            {
                par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
            }

            if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0)
            {
                BiomeGenBase[] abiomegenbase = biomeCache.getCachedBiomes(par2, par3);
                Array.Copy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
                return(par1ArrayOfBiomeGenBase);
            }

            int[] ai = biomeIndexLayer.getInts(par2, par3, par4, par5);

            for (int i = 0; i < par4 * par5; i++)
            {
                par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
            }

            return(par1ArrayOfBiomeGenBase);
        }
Пример #2
0
        /**
         * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
         * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
         */
        public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, bool par6)
        {
            IntCache.resetIntCache();

            if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.Length < par4 * par5)
            {
                par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
            }

            if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0)
            {
                BiomeGenBase[] abiomegenbase = biomeCache.getCachedBiomes(par2, par3);
                Array.Copy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
                return par1ArrayOfBiomeGenBase;
            }

            int[] ai = biomeIndexLayer.getInts(par2, par3, par4, par5);

            for (int i = 0; i < par4 * par5; i++)
            {
                par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
            }

            return par1ArrayOfBiomeGenBase;
        }