13
0
geforkt von Mirrors/Paper

Added ChunkSnapShot improvements. Thanks mikeprimm!

Added support for biome data to chunk snapshot
Added method for returning empty chunk snapshot (for ungenerated chunks)

By: EvilSeph <evilseph@unaligned.org>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-06-17 09:21:56 -04:00
Ursprung f1a6e194ef
Commit 05163fbadc
3 geänderte Dateien mit 47 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -46,6 +46,15 @@ public interface Chunk {
*/
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();
BlockState[] getTileEntities();

Datei anzeigen

@ -1,5 +1,6 @@
package org.bukkit;
import org.bukkit.block.Biome;
/**
* 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)
@ -76,6 +77,33 @@ public interface ChunkSnapshot {
*/
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
* @return time in ticks

Datei anzeigen

@ -608,6 +608,16 @@ public interface World {
*/
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
*/