public class Chunk
extends java.lang.Object
If the chunk is not yet loaded the loadedLayer field is equal to -1.
Modifier and Type | Field and Description |
---|---|
static int |
BIOME_LAYER |
protected AbstractLayer |
biomes |
static int |
BLOCK_LAYER |
static int |
CAVE_LAYER |
protected AbstractLayer |
caves |
protected AbstractLayer |
layer |
static java.lang.String |
LEVEL_BIOMES |
static java.lang.String |
LEVEL_HEIGHTMAP |
static java.lang.String |
LEVEL_SECTIONS |
protected AbstractLayer |
surface |
static int |
SURFACE_LAYER |
static int |
X_MAX
Chunk width.
|
static int |
Y_MAX
Chunk height.
|
static int |
Z_MAX
Chunk depth.
|
Constructor and Description |
---|
Chunk(ChunkPosition pos,
World world) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
biomeAt(int blockX,
int blockZ) |
int |
biomeColor() |
int |
caveColor() |
static int |
chunkIndex(int x,
int y,
int z) |
static int |
chunkXZIndex(int x,
int z) |
void |
getBlockData(byte[] blocks,
byte[] blockData,
byte[] biomes,
java.util.Collection<se.llbit.nbt.CompoundTag> tileEntities,
java.util.Collection<se.llbit.nbt.CompoundTag> entities)
Load the block data for this chunk.
|
ChunkPosition |
getPosition() |
boolean |
isEmpty() |
int |
layerColor() |
void |
loadChunk(WorldMapLoader loader)
Parse the chunk from the region file and render the current
layer, surface and cave maps.
|
void |
renderBiomes(MapTile tile) |
void |
renderCaves(MapTile tile) |
void |
renderHighlight(MapTile tile,
Block hlBlock,
int hlColor)
Render block highlight.
|
void |
renderLayer(MapTile tile) |
void |
renderSurface(MapTile tile) |
void |
renderTopography()
Render the topography of this chunk.
|
void |
reset()
Reset the rendered layers in this chunk.
|
int |
surfaceColor() |
java.lang.String |
toString() |
static void |
updateHeightmap(Heightmap heightmap,
ChunkPosition pos,
byte[] blocksArray,
int[] chunkHeightmap)
Load heightmap information from a chunk heightmap array
and insert into a quadtree.
|
public static final java.lang.String LEVEL_HEIGHTMAP
public static final java.lang.String LEVEL_SECTIONS
public static final java.lang.String LEVEL_BIOMES
public static final int X_MAX
public static final int Y_MAX
public static final int Z_MAX
public static final int BLOCK_LAYER
public static final int SURFACE_LAYER
public static final int CAVE_LAYER
public static final int BIOME_LAYER
protected volatile AbstractLayer layer
protected volatile AbstractLayer surface
protected volatile AbstractLayer caves
protected volatile AbstractLayer biomes
public Chunk(ChunkPosition pos, World world)
public void renderLayer(MapTile tile)
public int layerColor()
public void renderSurface(MapTile tile)
public int surfaceColor()
public void renderCaves(MapTile tile)
public int caveColor()
public void renderBiomes(MapTile tile)
public int biomeColor()
public void reset()
public ChunkPosition getPosition()
public void renderHighlight(MapTile tile, Block hlBlock, int hlColor)
public void loadChunk(WorldMapLoader loader)
public static void updateHeightmap(Heightmap heightmap, ChunkPosition pos, byte[] blocksArray, int[] chunkHeightmap)
public boolean isEmpty()
true
if this is an empty (non-existing) chunkpublic void renderTopography()
public void getBlockData(byte[] blocks, byte[] blockData, byte[] biomes, java.util.Collection<se.llbit.nbt.CompoundTag> tileEntities, java.util.Collection<se.llbit.nbt.CompoundTag> entities)
public static int chunkIndex(int x, int y, int z)
public static int chunkXZIndex(int x, int z)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String biomeAt(int blockX, int blockZ)