Added ChunkSnapShot improvements. Thanks mikeprimm!
Added support for biome data to chunk snapshot Added method for returning empty chunk snapshot (for ungenerated chunks)
This commit is contained in:
parent
293a4d9ae2
commit
79815f7d9a
@ -46,6 +46,15 @@ public interface Chunk {
|
|||||||
*/
|
*/
|
||||||
ChunkSnapshot getChunkSnapshot();
|
ChunkSnapshot getChunkSnapshot();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Capture thread-safe read-only snapshot of chunk data
|
||||||
|
* @param includeMaxblocky - if true, snapshot includes per-coordinate maximum Y values
|
||||||
|
* @param includeBiome - if true, snapshot includes per-coordinate biome type
|
||||||
|
* @param includeBiomeTempRain - if true, snapshot includes per-coordinate raw biome temperature and rainfall
|
||||||
|
* @return ChunkSnapshot
|
||||||
|
*/
|
||||||
|
ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain);
|
||||||
|
|
||||||
Entity[] getEntities();
|
Entity[] getEntities();
|
||||||
|
|
||||||
BlockState[] getTileEntities();
|
BlockState[] getTileEntities();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.bukkit;
|
package org.bukkit;
|
||||||
|
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
/**
|
/**
|
||||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
* 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)
|
* 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)
|
||||||
@ -76,6 +77,33 @@ public interface ChunkSnapshot {
|
|||||||
*/
|
*/
|
||||||
int getHighestBlockYAt(int x, int z);
|
int getHighestBlockYAt(int x, int z);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get world full time when chunk snapshot was captured
|
* Get world full time when chunk snapshot was captured
|
||||||
* @return time in ticks
|
* @return time in ticks
|
||||||
|
@ -608,6 +608,16 @@ public interface World {
|
|||||||
*/
|
*/
|
||||||
public void playEffect(Location location, Effect effect, int data, int radius);
|
public void playEffect(Location location, Effect effect, int data, int radius);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome
|
||||||
|
* data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk.
|
||||||
|
* @param x - chunk x coordinate
|
||||||
|
* @param z - chunk z coordinate
|
||||||
|
* @param includeBiome - if true, snapshot includes per-coordinate biome type
|
||||||
|
* @param includeBiomeTempRain - if true, snapshot includes per-coordinate raw biome temperature and rainfall
|
||||||
|
*/
|
||||||
|
public ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTempRain);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents various map environment types that a world may be
|
* Represents various map environment types that a world may be
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user