PocketMine
BaseChunk Class Reference
Inheritance diagram for BaseChunk:
BaseFullChunk Chunk FullChunk FullChunk Chunk

Public Member Functions

 getBlock ($x, $y, $z, &$blockId, &$meta=null)
 
 getFullBlock ($x, $y, $z)
 
 setBlock ($x, $y, $z, $blockId=null, $meta=null)
 
 getBlockId ($x, $y, $z)
 
 setBlockId ($x, $y, $z, $id)
 
 getBlockData ($x, $y, $z)
 
 setBlockData ($x, $y, $z, $data)
 
 getBlockSkyLight ($x, $y, $z)
 
 setBlockSkyLight ($x, $y, $z, $data)
 
 getBlockLight ($x, $y, $z)
 
 setBlockLight ($x, $y, $z, $data)
 
 getBlockIdColumn ($x, $z)
 
 getBlockDataColumn ($x, $z)
 
 getBlockSkyLightColumn ($x, $z)
 
 getBlockLightColumn ($x, $z)
 
 isSectionEmpty ($fY)
 
 getSection ($fY)
 
 setSection ($fY, ChunkSection $section)
 
 load ($generate=true)
 
 getBlockIdArray ()
 
 getBlockDataArray ()
 
 getBlockSkyLightArray ()
 
 getBlockLightArray ()
 
 getSections ()
 
- Public Member Functions inherited from BaseFullChunk
 initChunk ()
 
 getX ()
 
 getZ ()
 
 setX ($x)
 
 setZ ($z)
 
 getLevel ()
 
 getProvider ()
 
 setProvider (LevelProvider $provider)
 
 getBiomeId ($x, $z)
 
 setBiomeId ($x, $z, $biomeId)
 
 getBiomeColor ($x, $z)
 
 setBiomeColor ($x, $z, $R, $G, $B)
 
 getHeightMap ($x, $z)
 
 setHeightMap ($x, $z, $value)
 
 recalculateHeightMap ()
 
 getBlockExtraData ($x, $y, $z)
 
 setBlockExtraData ($x, $y, $z, $data)
 
 populateSkyLight ()
 
 getHighestBlockAt ($x, $z, $cache=true)
 
 addEntity (Entity $entity)
 
 removeEntity (Entity $entity)
 
 addTile (Tile $tile)
 
 removeTile (Tile $tile)
 
 getEntities ()
 
 getTiles ()
 
 getBlockExtraDataArray ()
 
 getTile ($x, $y, $z)
 
 isLoaded ()
 
 load ($generate=true)
 
 unload ($save=true, $safe=true)
 
 getBlockIdArray ()
 
 getBlockDataArray ()
 
 getBlockSkyLightArray ()
 
 getBlockLightArray ()
 
 getBiomeIdArray ()
 
 getBiomeColorArray ()
 
 getHeightMapArray ()
 
 hasChanged ()
 
 setChanged ($changed=true)
 
 toFastBinary ()
 
 isLightPopulated ()
 
 setLightPopulated ($value=1)
 
- Public Member Functions inherited from FullChunk
 getHighestBlockAt ($x, $z)
 
 isPopulated ()
 
 setPopulated ($value=1)
 
 isGenerated ()
 
 setGenerated ($value=1)
 
 toBinary ()
 

Protected Member Functions

 __construct ($provider, $x, $z, array $sections, array $biomeColors=[], array $heightMap=[], array $entities=[], array $tiles=[])
 
- Protected Member Functions inherited from BaseFullChunk
 __construct ($provider, $x, $z, $blocks, $data, $skyLight, $blockLight, array $biomeColors=[], array $heightMap=[], array $entities=[], array $tiles=[], array $extraData=[])
 
 checkOldBiomes ($data)
 

Protected Attributes

 $sections = []
 
- Protected Attributes inherited from BaseFullChunk
 $entities = []
 
 $tiles = []
 
 $tileList = []
 
 $biomeColors
 
 $blocks
 
 $data
 
 $skyLight
 
 $blockLight
 
 $heightMap
 
 $NBTtiles
 
 $NBTentities
 
 $extraData = []
 
 $provider
 
 $x
 
 $z
 
 $hasChanged = false
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseFullChunk
static fromFastBinary ($data, LevelProvider $provider=null)
 
- Static Public Member Functions inherited from FullChunk
static fromBinary ($data, LevelProvider $provider=null)
 
static getEmptyChunk ($chunkX, $chunkZ, LevelProvider $provider=null)
 
- Data Fields inherited from Chunk
const SECTION_COUNT = 8
 

Constructor & Destructor Documentation

__construct (   $provider,
  $x,
  $z,
array  $sections,
array  $biomeColors = [],
array  $heightMap = [],
array  $entities = [],
array  $tiles = [] 
)
protected
Parameters
LevelProvider$provider
int$x
int$z
ChunkSection[]$sections
int[]$biomeColors
int[]$heightMap
Compound[]$entities
Compound[]$tiles
Exceptions
ChunkException

Member Function Documentation

getBlock (   $x,
  $y,
  $z,
$blockId,
$meta = null 
)

Modifies $blockId and $meta

Deprecated:
Parameters
int$x0-15
int$y0-127
int$z0-15
int&$blockId
int&$meta

Implements FullChunk.

getBlockData (   $x,
  $y,
  $z 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implements FullChunk.

getBlockId (   $x,
  $y,
  $z 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-255

Implements FullChunk.

getBlockLight (   $x,
  $y,
  $z 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implements FullChunk.

getBlockSkyLight (   $x,
  $y,
  $z 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implements FullChunk.

getFullBlock (   $x,
  $y,
  $z 
)

Gets block and meta in one go

Parameters
int$x0-15
int$y0-15
int$z0-15
Returns
int bitmap, (id << 4) | data

Implements FullChunk.

getSection (   $fY)
Parameters
int$fY0-7
Returns
ChunkSection

Implements Chunk.

getSections ( )
Returns
ChunkSection[]

Implements Chunk.

isSectionEmpty (   $fY)

Tests whether a section (mini-chunk) is empty

Parameters
$fY0-7, (Y / 16)
Returns
bool

Implements Chunk.

load (   $generate = true)

Loads the chunk

Parameters
bool$generateIf the chunk does not exist, generate it
Returns
bool

Implements FullChunk.

setBlock (   $x,
  $y,
  $z,
  $blockId = null,
  $meta = null 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
int$blockId,ifnull, do not change
int$meta0-15, if null, do not change

Implements FullChunk.

setBlockData (   $x,
  $y,
  $z,
  $data 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
int$data0-15

Implements FullChunk.

setBlockId (   $x,
  $y,
  $z,
  $id 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
int$id0-255

Implements FullChunk.

setBlockLight (   $x,
  $y,
  $z,
  $level 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
int$level0-15

Implements FullChunk.

setBlockSkyLight (   $x,
  $y,
  $z,
  $level 
)
Parameters
int$x0-15
int$y0-127
int$z0-15
int$level0-15

Implements FullChunk.

setSection (   $fY,
ChunkSection  $section 
)
Parameters
int$fY0-7
ChunkSection$section
Returns
boolean

Implements Chunk.


The documentation for this class was generated from the following file: