PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\level\format\generic\BaseFullChunk Class Reference
+ Inheritance diagram for pocketmine\level\format\generic\BaseFullChunk:
+ Collaboration diagram for pocketmine\level\format\generic\BaseFullChunk:

Public Member Functions

 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)
 
 getHighestBlockAt ($x, $z)
 
 addEntity (Entity $entity)
 
 removeEntity (Entity $entity)
 
 addTile (Tile $tile)
 
 removeTile (Tile $tile)
 
 getEntities ()
 
 getTiles ()
 
 getTile ($x, $y, $z)
 
 isLoaded ()
 
 load ($generate=true)
 
 unload ($save=true, $safe=true)
 
 getBlockIdArray ()
 
 getBlockDataArray ()
 
 getBlockSkyLightArray ()
 
 getBlockLightArray ()
 
 getBiomeIdArray ()
 
 getBiomeColorArray ()
 
 getHeightMapArray ()
 
 hasChanged ()
 
 setChanged ($changed=true)
 
 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, $level)
 
 getBlockLight ($x, $y, $z)
 
 setBlockLight ($x, $y, $z, $level)
 
 getBlockIdColumn ($x, $z)
 
 getBlockDataColumn ($x, $z)
 
 getBlockSkyLightColumn ($x, $z)
 
 getBlockLightColumn ($x, $z)
 
 isPopulated ()
 
 setPopulated ($value=1)
 
 isGenerated ()
 
 setGenerated ($value=1)
 
 toBinary ()
 

Static Public Member Functions

static fromBinary ($data, LevelProvider $provider=null)
 

Protected Member Functions

 __construct ($provider, $x, $z, $blocks, $data, $skyLight, $blockLight, $biomeIds=null, array $biomeColors=[], array $heightMap=[], array $entities=[], array $tiles=[])
 

Protected Attributes

 $entities = []
 
 $tiles = []
 
 $tileList = []
 
 $biomeIds
 
 $biomeColors
 
 $blocks
 
 $data
 
 $skyLight
 
 $blockLight
 
 $heightMap
 
 $NBTtiles
 
 $NBTentities
 
 $provider
 
 $x
 
 $z
 
 $hasChanged = false
 

Detailed Description

Definition at line 32 of file BaseFullChunk.php.

Constructor & Destructor Documentation

pocketmine\level\format\generic\BaseFullChunk::__construct (   $provider,
  $x,
  $z,
  $blocks,
  $data,
  $skyLight,
  $blockLight,
  $biomeIds = null,
array  $biomeColors = [],
array  $heightMap = [],
array  $entities = [],
array  $tiles = [] 
)
protected
Parameters
LevelProvider$provider
int$x
int$z
string$blocks
string$data
string$skyLight
string$blockLight
string$biomeIds
int[]$biomeColors
int[]$heightMap
Compound[]$entities
Compound[]$tiles

Definition at line 85 of file BaseFullChunk.php.

Member Function Documentation

pocketmine\level\format\generic\BaseFullChunk::addEntity ( Entity  $entity)
Parameters
Entity$entity

Implements pocketmine\level\format\FullChunk.

Definition at line 245 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::addTile ( Tile  $tile)
Parameters
Tile$tile

Implements pocketmine\level\format\FullChunk.

Definition at line 255 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

static pocketmine\level\format\FullChunk::fromBinary (   $data,
LevelProvider  $provider = null 
)
staticinherited
pocketmine\level\format\generic\BaseFullChunk::getBiomeColor (   $x,
  $z 
)
Parameters
int$x
int$z
Returns
int[] RGB bytes

Implements pocketmine\level\format\FullChunk.

Definition at line 215 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getBiomeColorArray ( )
Returns
int[]

Implements pocketmine\level\format\FullChunk.

Definition at line 340 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getBiomeId (   $x,
  $z 
)
Parameters
int$x0-15
int$z0-15
Returns
int 0-255

Implements pocketmine\level\format\FullChunk.

Definition at line 206 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getBiomeIdArray ( )
Returns
string[]

Implements pocketmine\level\format\FullChunk.

Definition at line 336 of file BaseFullChunk.php.

pocketmine\level\format\FullChunk::getBlock (   $x,
  $y,
  $z,
$blockId,
$meta = null 
)
inherited

Modifies $blockId and $meta

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

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\leveldb\Chunk, and pocketmine\level\format\generic\BaseChunk.

pocketmine\level\format\FullChunk::getBlockData (   $x,
  $y,
  $z 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implemented in pocketmine\level\format\generic\BaseChunk, pocketmine\level\format\mcregion\Chunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\FullChunk::getBlockId (   $x,
  $y,
  $z 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-255

Implemented in pocketmine\level\format\generic\BaseChunk, pocketmine\level\format\mcregion\Chunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\FullChunk::getBlockLight (   $x,
  $y,
  $z 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\leveldb\Chunk, and pocketmine\level\format\generic\BaseChunk.

pocketmine\level\format\FullChunk::getBlockSkyLight (   $x,
  $y,
  $z 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
Returns
int 0-15

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\generic\BaseChunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\generic\BaseFullChunk::getEntities ( )
Returns
[]

Implements pocketmine\level\format\FullChunk.

Definition at line 270 of file BaseFullChunk.php.

Referenced by pocketmine\level\format\generic\BaseFullChunk\unload().

+ Here is the caller graph for this function:

pocketmine\level\format\FullChunk::getFullBlock (   $x,
  $y,
  $z 
)
inherited

Gets block and meta in one go

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

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\generic\BaseChunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\generic\BaseFullChunk::getHeightMap (   $x,
  $z 
)
Parameters
int$x0-15
int$z0-15
Returns
int 0-255

Implements pocketmine\level\format\FullChunk.

Definition at line 226 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getHeightMapArray ( )
Returns
int[]

Implements pocketmine\level\format\FullChunk.

Definition at line 344 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getHighestBlockAt (   $x,
  $z 
)
Parameters
int$x0-15
int$z0-15
Returns
int 0-127

Implements pocketmine\level\format\FullChunk.

Definition at line 234 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getLevel ( )
Returns
LevelProvider
Deprecated:

Definition at line 191 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\getProvider().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::getTile (   $x,
  $y,
  $z 
)
Parameters
int$x0-15
int$y0-127
int$z0-15

Implements pocketmine\level\format\FullChunk.

Definition at line 278 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::getTiles ( )
Returns
[]

Implements pocketmine\level\format\FullChunk.

Definition at line 274 of file BaseFullChunk.php.

Referenced by pocketmine\level\format\generic\BaseFullChunk\unload().

+ Here is the caller graph for this function:

pocketmine\level\format\generic\BaseFullChunk::getX ( )
Returns
int

Implements pocketmine\level\format\FullChunk.

Definition at line 170 of file BaseFullChunk.php.

Referenced by pocketmine\level\format\generic\BaseFullChunk\isLoaded(), pocketmine\level\format\generic\BaseChunk\load(), pocketmine\level\format\generic\BaseFullChunk\load(), and pocketmine\level\format\generic\BaseFullChunk\unload().

+ Here is the caller graph for this function:

pocketmine\level\format\generic\BaseFullChunk::getZ ( )
Returns
int

Implements pocketmine\level\format\FullChunk.

Definition at line 174 of file BaseFullChunk.php.

Referenced by pocketmine\level\format\generic\BaseFullChunk\isLoaded(), pocketmine\level\format\generic\BaseChunk\load(), pocketmine\level\format\generic\BaseFullChunk\load(), and pocketmine\level\format\generic\BaseFullChunk\unload().

+ Here is the caller graph for this function:

pocketmine\level\format\generic\BaseFullChunk::hasChanged ( )
Returns
boolean

Implements pocketmine\level\format\FullChunk.

Definition at line 348 of file BaseFullChunk.php.

Referenced by pocketmine\level\format\generic\BaseFullChunk\addEntity(), pocketmine\level\format\generic\BaseFullChunk\addTile(), pocketmine\level\format\generic\BaseFullChunk\removeEntity(), pocketmine\level\format\generic\BaseFullChunk\removeTile(), pocketmine\level\format\generic\BaseFullChunk\setBiomeColor(), pocketmine\level\format\generic\BaseFullChunk\setBiomeId(), pocketmine\level\format\generic\BaseChunk\setBlock(), pocketmine\level\format\leveldb\Chunk\setBlock(), pocketmine\level\format\mcregion\Chunk\setBlock(), pocketmine\level\format\leveldb\Chunk\setBlockData(), pocketmine\level\format\mcregion\Chunk\setBlockData(), pocketmine\level\format\generic\BaseChunk\setBlockData(), pocketmine\level\format\leveldb\Chunk\setBlockId(), pocketmine\level\format\mcregion\Chunk\setBlockId(), pocketmine\level\format\generic\BaseChunk\setBlockId(), pocketmine\level\format\generic\BaseChunk\setBlockLight(), pocketmine\level\format\leveldb\Chunk\setBlockLight(), pocketmine\level\format\mcregion\Chunk\setBlockLight(), pocketmine\level\format\generic\BaseChunk\setBlockSkyLight(), pocketmine\level\format\leveldb\Chunk\setBlockSkyLight(), pocketmine\level\format\mcregion\Chunk\setBlockSkyLight(), pocketmine\level\format\generic\BaseFullChunk\setChanged(), pocketmine\level\format\generic\BaseChunk\setSection(), and pocketmine\level\format\generic\BaseFullChunk\unload().

+ Here is the caller graph for this function:

pocketmine\level\format\generic\BaseFullChunk::isLoaded ( )
Returns
bool

Implements pocketmine\level\format\FullChunk.

Definition at line 283 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\getProvider(), pocketmine\level\format\generic\BaseFullChunk\getX(), and pocketmine\level\format\generic\BaseFullChunk\getZ().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::load (   $generate = true)

Loads the chunk

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

Implements pocketmine\level\format\FullChunk.

Definition at line 287 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\getProvider(), pocketmine\level\format\generic\BaseFullChunk\getX(), and pocketmine\level\format\generic\BaseFullChunk\getZ().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::removeEntity ( Entity  $entity)
Parameters
Entity$entity

Implements pocketmine\level\format\FullChunk.

Definition at line 250 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::removeTile ( Tile  $tile)
Parameters
Tile$tile

Implements pocketmine\level\format\FullChunk.

Definition at line 264 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::setBiomeColor (   $x,
  $z,
  $R,
  $G,
  $B 
)
Parameters
int$x0-15
int$z0-15
int$R0-255
int$G0-255
int$B0-255

Implements pocketmine\level\format\FullChunk.

Definition at line 221 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::setBiomeId (   $x,
  $z,
  $biomeId 
)
Parameters
int$x0-15
int$z0-15
int$biomeId0-255

Implements pocketmine\level\format\FullChunk.

Definition at line 210 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\FullChunk::setBlock (   $x,
  $y,
  $z,
  $blockId = null,
  $meta = null 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
int$blockId,ifnull, do not change
int$meta0-15, if null, do not change

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\leveldb\Chunk, and pocketmine\level\format\generic\BaseChunk.

pocketmine\level\format\FullChunk::setBlockData (   $x,
  $y,
  $z,
  $data 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
int$data0-15

Implemented in pocketmine\level\format\generic\BaseChunk, pocketmine\level\format\mcregion\Chunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\FullChunk::setBlockId (   $x,
  $y,
  $z,
  $id 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
int$id0-255

Implemented in pocketmine\level\format\generic\BaseChunk, pocketmine\level\format\mcregion\Chunk, and pocketmine\level\format\leveldb\Chunk.

pocketmine\level\format\FullChunk::setBlockLight (   $x,
  $y,
  $z,
  $level 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
int$level0-15

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\leveldb\Chunk, and pocketmine\level\format\generic\BaseChunk.

pocketmine\level\format\FullChunk::setBlockSkyLight (   $x,
  $y,
  $z,
  $level 
)
inherited
Parameters
int$x0-15
int$y0-127
int$z0-15
int$level0-15

Implemented in pocketmine\level\format\mcregion\Chunk, pocketmine\level\format\leveldb\Chunk, and pocketmine\level\format\generic\BaseChunk.

pocketmine\level\format\generic\BaseFullChunk::setChanged (   $changed = true)
Parameters
bool$changed

Implements pocketmine\level\format\FullChunk.

Definition at line 352 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:

pocketmine\level\format\generic\BaseFullChunk::setHeightMap (   $x,
  $z,
  $value 
)
Parameters
int$x0-15
int$z0-15
$value0-255

Implements pocketmine\level\format\FullChunk.

Definition at line 230 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::setProvider ( LevelProvider  $provider)
Parameters
LevelProvider$provider

Implements pocketmine\level\format\FullChunk.

Definition at line 202 of file BaseFullChunk.php.

pocketmine\level\format\generic\BaseFullChunk::unload (   $save = true,
  $safe = true 
)
Parameters
bool$save
bool$safeIf false, unload the chunk even if players are nearby
Returns
bool

Implements pocketmine\level\format\FullChunk.

Definition at line 291 of file BaseFullChunk.php.

References pocketmine\level\format\generic\BaseFullChunk\getEntities(), pocketmine\level\format\generic\BaseFullChunk\getProvider(), pocketmine\level\format\generic\BaseFullChunk\getTiles(), pocketmine\level\format\generic\BaseFullChunk\getX(), pocketmine\level\format\generic\BaseFullChunk\getZ(), and pocketmine\level\format\generic\BaseFullChunk\hasChanged().

+ Here is the call graph for this function:


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