|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.morbz.minecraft.world.Chunk
public class Chunk
Defines a chunk. It consists of 16x16 blocks in XZ-dimension and up to 16 sections for the height.
Field Summary | |
---|---|
static int |
BLOCKS_PER_CHUNK_SIDE
Blocks per chunk side |
static int |
SECTIONS_PER_CHUNK
Sections per chunk |
Constructor Summary | |
---|---|
Chunk(IBlockContainer parent,
int xPos,
int zPos,
DefaultLayers layers)
Creates a new instance. |
Method Summary | |
---|---|
void |
addSkyLight()
Adds the sky light. |
void |
calculateHeightMap()
Calculates the height map. |
int |
getHighestBlock(int x,
int z)
Returns the highest non transparent block. calculateHeightMap() has to be invoked before calling this method to get actual results. |
byte |
getSkyLight(int x,
int y,
int z)
Returns the sky light level of the block at given position. |
byte |
getSkyLightFromParent(IBlockContainer child,
int childX,
int childY,
int childZ)
Returns the sky light level of a block that is out of bounds of the child block container. |
org.jnbt.Tag |
getTag()
Returns an instance of a subclass of the NBT-Tag class. |
int |
getX()
|
int |
getZ()
|
boolean |
hasBlocks()
Has at least 1 block that is not air. |
void |
setBlock(int x,
int y,
int z,
IBlock block)
Sets a block at the given position. |
void |
spreadSkyLight(byte light)
Spreads the skylight. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SECTIONS_PER_CHUNK
public static final int BLOCKS_PER_CHUNK_SIDE
Constructor Detail |
---|
public Chunk(IBlockContainer parent, int xPos, int zPos, DefaultLayers layers)
parent
- The parent block containerxPos
- The X-coordinate within the regionzPos
- The Z-coordinate within the regionlayers
- The default layers. Can be 'null'Method Detail |
---|
public int getX()
public int getZ()
public void setBlock(int x, int y, int z, IBlock block)
x
- The X-coordinate within the chunky
- The Y-coordinatez
- The Z-coordinate within the chunkblock
- The blockpublic byte getSkyLight(int x, int y, int z)
getSkyLight
in interface IBlockContainer
x
- The local X-coordinatey
- The local Y-coordinatez
- The local Z-coordinate
public byte getSkyLightFromParent(IBlockContainer child, int childX, int childY, int childZ)
getSkyLightFromParent
in interface IBlockContainer
child
- The child block containerchildX
- The local X-coordinatechildY
- The local Y-coordinatechildZ
- The local Z-coordinate
public void spreadSkyLight(byte light)
spreadSkyLight
in interface IBlockContainer
light
- The light levelpublic void addSkyLight()
public int getHighestBlock(int x, int z)
x
- The X-coordinatez
- The Z-coordinate
public boolean hasBlocks()
public void calculateHeightMap()
public org.jnbt.Tag getTag()
getTag
in interface ITagProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |