|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.morbz.minecraft.world.Region
public class Region
Defines a region. It consists of up to 32x32 chunks in XZ-dimension.
| Field Summary | |
|---|---|
static int |
BLOCKS_PER_REGION_SIDE
Blocks per region side |
static int |
CHUNKS_PER_REGION_SIDE
Chunks per region side |
| Constructor Summary | |
|---|---|
Region(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 maps for all chunks. |
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. |
int |
getX()
|
int |
getZ()
|
void |
setBlock(int x,
int y,
int z,
IBlock block)
Sets a block at the given position. |
void |
spreadSkyLight(byte light)
Spreads the skylight. |
void |
writeToFile(java.io.File path)
Writes this region to a file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CHUNKS_PER_REGION_SIDE
public static final int BLOCKS_PER_REGION_SIDE
| Constructor Detail |
|---|
public Region(IBlockContainer parent,
int xPos,
int zPos,
DefaultLayers layers)
parent - The parent block containerlayers - The default layers. Can be 'null'xPos - The X-coordinate within the worldzPos - The Z-coordinate within the world| 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 regiony - The Y-coordinatez - The Z-coordinate within the regionblock - The block
public byte getSkyLight(int x,
int y,
int z)
getSkyLight in interface IBlockContainerx - 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 IBlockContainerchild - The child block containerchildX - The local X-coordinatechildY - The local Y-coordinatechildZ - The local Z-coordinate
public void spreadSkyLight(byte light)
spreadSkyLight in interface IBlockContainerlight - The light levelpublic void addSkyLight()
public int getHighestBlock(int x,
int z)
x - The X-coordinatez - The Z-coordinate
public void calculateHeightMap()
public void writeToFile(java.io.File path)
throws java.io.IOException
path - The path to write the file
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||