001    package org.bukkit;
002    
003    import org.bukkit.block.Biome;
004    
005    /**
006     * Represents a static, thread-safe snapshot of chunk of blocks.
007     * <p>
008     * Purpose is to allow clean, efficient copy of a chunk data to be made, and
009     * then handed off for processing in another thread (e.g. map rendering)
010     */
011    public interface ChunkSnapshot {
012    
013        /**
014         * Gets the X-coordinate of this chunk
015         *
016         * @return X-coordinate
017         */
018        int getX();
019    
020        /**
021         * Gets the Z-coordinate of this chunk
022         *
023         * @return Z-coordinate
024         */
025        int getZ();
026    
027        /**
028         * Gets name of the world containing this chunk
029         *
030         * @return Parent World Name
031         */
032        String getWorldName();
033    
034        /**
035         * Get block type for block at corresponding coordinate in the chunk
036         *
037         * @param x 0-15
038         * @param y 0-127
039         * @param z 0-15
040         * @return 0-255
041         * @deprecated Magic value
042         */
043        @Deprecated
044        int getBlockTypeId(int x, int y, int z);
045    
046        /**
047         * Get block data for block at corresponding coordinate in the chunk
048         *
049         * @param x 0-15
050         * @param y 0-127
051         * @param z 0-15
052         * @return 0-15
053         * @deprecated Magic value
054         */
055        @Deprecated
056        int getBlockData(int x, int y, int z);
057    
058        /**
059         * Get sky light level for block at corresponding coordinate in the chunk
060         *
061         * @param x 0-15
062         * @param y 0-127
063         * @param z 0-15
064         * @return 0-15
065         */
066        int getBlockSkyLight(int x, int y, int z);
067    
068        /**
069         * Get light level emitted by block at corresponding coordinate in the
070         * chunk
071         *
072         * @param x 0-15
073         * @param y 0-127
074         * @param z 0-15
075         * @return 0-15
076         */
077        int getBlockEmittedLight(int x, int y, int z);
078    
079        /**
080         * Gets the highest non-air coordinate at the given coordinates
081         *
082         * @param x X-coordinate of the blocks
083         * @param z Z-coordinate of the blocks
084         * @return Y-coordinate of the highest non-air block
085         */
086        int getHighestBlockYAt(int x, int z);
087    
088        /**
089         * Get biome at given coordinates
090         *
091         * @param x X-coordinate
092         * @param z Z-coordinate
093         * @return Biome at given coordinate
094         */
095        Biome getBiome(int x, int z);
096    
097        /**
098         * Get raw biome temperature (0.0-1.0) at given coordinate
099         *
100         * @param x X-coordinate
101         * @param z Z-coordinate
102         * @return temperature at given coordinate
103         */
104        double getRawBiomeTemperature(int x, int z);
105    
106        /**
107         * Get raw biome rainfall (0.0-1.0) at given coordinate
108         *
109         * @param x X-coordinate
110         * @param z Z-coordinate
111         * @return rainfall at given coordinate
112         */
113        double getRawBiomeRainfall(int x, int z);
114    
115        /**
116         * Get world full time when chunk snapshot was captured
117         *
118         * @return time in ticks
119         */
120        long getCaptureFullTime();
121    
122        /**
123         * Test if section is empty
124         *
125         * @param sy - section Y coordinate (block Y / 16)
126         * @return true if empty, false if not
127         */
128        boolean isSectionEmpty(int sy);
129    }