    001package net.minecraft.world.biome;
    002
    003public class BiomeCacheBlock
    004{
    005    /** An array of chunk temperatures saved by this cache. */
    006    public float[] temperatureValues;
    007
    008    /** An array of chunk rainfall values saved by this cache. */
    009    public float[] rainfallValues;
    010
    011    /** The array of biome types stored in this BiomeCacheBlock. */
    012    public BiomeGenBase[] biomes;
    013
    014    /** The x coordinate of the BiomeCacheBlock. */
    015    public int xPosition;
    016
    017    /** The z coordinate of the BiomeCacheBlock. */
    018    public int zPosition;
    019
    020    /** The last time this BiomeCacheBlock was accessed, in milliseconds. */
    021    public long lastAccessTime;
    022
    023    /** The BiomeCache object that contains this BiomeCacheBlock */
    024    final BiomeCache theBiomeCache;
    025
    026    public BiomeCacheBlock(BiomeCache par1BiomeCache, int par2, int par3)
    027    {
    028        this.theBiomeCache = par1BiomeCache;
    029        this.temperatureValues = new float[256];
    030        this.rainfallValues = new float[256];
    031        this.biomes = new BiomeGenBase[256];
    032        this.xPosition = par2;
    033        this.zPosition = par3;
    034        BiomeCache.getChunkManager(par1BiomeCache).getTemperatures(this.temperatureValues, par2 << 4, par3 << 4, 16, 16);
    035        BiomeCache.getChunkManager(par1BiomeCache).getRainfall(this.rainfallValues, par2 << 4, par3 << 4, 16, 16);
    036        BiomeCache.getChunkManager(par1BiomeCache).getBiomeGenAt(this.biomes, par2 << 4, par3 << 4, 16, 16, false);
    037    }
    038
    039    /**
    040     * Returns the BiomeGenBase related to the x, z position from the cache block.
    041     */
    042    public BiomeGenBase getBiomeGenAt(int par1, int par2)
    043    {
    044        return this.biomes[par1 & 15 | (par2 & 15) << 4];
    045    }
    046}