public class ChunkLOD
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
biome
Current biome ID
|
int |
cx
Chunk offset x
|
int |
cz
Chunk offset z
|
byte[] |
surfaceData
Converted surface, flattened 3 x 20 x 20 (LAYERS x X x Z) array
|
| Constructor and Description |
|---|
ChunkLOD(int cx,
int cz,
int biome,
byte[] surfaceData)
Creates a new chunk object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBiome()
Gets the biome ID of this chunk.
|
int |
getRawArrayIndex(int layer,
int x,
int z)
Calculates the index in order to access the surface directly.
|
short |
getSurfaceElevation(int x,
int z)
Gets the surface elevation at the given position.
|
byte |
getSurfaceTerrainID(int x,
int z)
Gets the surface terrain ID (texture) at the given position.
|
void |
setBiome(int newBiomeID)
Sets the new biome ID.
|
public int cx
public int cz
public int biome
public byte[] surfaceData
public ChunkLOD(int cx,
int cz,
int biome,
byte[] surfaceData)
cx - the x chunk offset.cz - the z chunk offset.biome - biome ID.surfaceData - a byte-array representing the converted terrain data.public int getBiome()
public void setBiome(int newBiomeID)
newBiomeID - the new biome ID.public byte getSurfaceTerrainID(int x,
int z)
x - the x block position.z - the z block position.public short getSurfaceElevation(int x,
int z)
x - the x block position.z - the z block position.public int getRawArrayIndex(int layer,
int x,
int z)
layer - the layer index (0-2).x - the x index.z - the z index.Chunk.getRawArrayIndex(int, int, int)