2011-06-07 03:22:03 -04:00
|
|
|
package org.bukkit;
|
|
|
|
|
2011-06-17 09:21:56 -04:00
|
|
|
import org.bukkit.block.Biome;
|
2011-06-07 03:22:03 -04:00
|
|
|
/**
|
|
|
|
* Represents a static, thread-safe snapshot of chunk of blocks
|
|
|
|
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
|
|
|
|
*/
|
|
|
|
public interface ChunkSnapshot {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the X-coordinate of this chunk
|
|
|
|
*
|
|
|
|
* @return X-coordinate
|
|
|
|
*/
|
|
|
|
int getX();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Z-coordinate of this chunk
|
|
|
|
*
|
|
|
|
* @return Z-coordinate
|
|
|
|
*/
|
|
|
|
int getZ();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets name of the world containing this chunk
|
|
|
|
*
|
|
|
|
* @return Parent World Name
|
|
|
|
*/
|
|
|
|
String getWorldName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get block type for block at corresponding coordinate in the chunk
|
|
|
|
*
|
|
|
|
* @param x 0-15
|
|
|
|
* @param y 0-127
|
|
|
|
* @param z 0-15
|
|
|
|
* @return 0-255
|
|
|
|
*/
|
|
|
|
int getBlockTypeId(int x, int y, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get block data for block at corresponding coordinate in the chunk
|
|
|
|
*
|
|
|
|
* @param x 0-15
|
|
|
|
* @param y 0-127
|
|
|
|
* @param z 0-15
|
|
|
|
* @return 0-15
|
|
|
|
*/
|
|
|
|
int getBlockData(int x, int y, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get sky light level for block at corresponding coordinate in the chunk
|
|
|
|
*
|
|
|
|
* @param x 0-15
|
|
|
|
* @param y 0-127
|
|
|
|
* @param z 0-15
|
|
|
|
* @return 0-15
|
|
|
|
*/
|
|
|
|
int getBlockSkyLight(int x, int y, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get light level emitted by block at corresponding coordinate in the chunk
|
|
|
|
*
|
|
|
|
* @param x 0-15
|
|
|
|
* @param y 0-127
|
|
|
|
* @param z 0-15
|
|
|
|
* @return 0-15
|
|
|
|
*/
|
|
|
|
int getBlockEmittedLight(int x, int y, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the highest non-air coordinate at the given coordinates
|
|
|
|
*
|
|
|
|
* @param x X-coordinate of the blocks
|
|
|
|
* @param z Z-coordinate of the blocks
|
|
|
|
* @return Y-coordinate of the highest non-air block
|
|
|
|
*/
|
|
|
|
int getHighestBlockYAt(int x, int z);
|
|
|
|
|
2011-06-17 09:21:56 -04:00
|
|
|
/**
|
|
|
|
* Get biome at given coordinates
|
|
|
|
*
|
|
|
|
* @param x X-coordinate
|
|
|
|
* @param z Z-coordinate
|
|
|
|
* @return Biome at given coordinate
|
|
|
|
*/
|
|
|
|
Biome getBiome(int x, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get raw biome temperature (0.0-1.0) at given coordinate
|
|
|
|
*
|
|
|
|
* @param x X-coordinate
|
|
|
|
* @param z Z-coordinate
|
|
|
|
* @return temperature at given coordinate
|
|
|
|
*/
|
|
|
|
double getRawBiomeTemperature(int x, int z);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get raw biome rainfall (0.0-1.0) at given coordinate
|
|
|
|
*
|
|
|
|
* @param x X-coordinate
|
|
|
|
* @param z Z-coordinate
|
|
|
|
* @return rainfall at given coordinate
|
|
|
|
*/
|
|
|
|
double getRawBiomeRainfall(int x, int z);
|
|
|
|
|
2011-06-07 03:22:03 -04:00
|
|
|
/**
|
|
|
|
* Get world full time when chunk snapshot was captured
|
|
|
|
* @return time in ticks
|
|
|
|
*/
|
|
|
|
long getCaptureFullTime();
|
|
|
|
}
|