PHP Interface pocketmine\level\ChunkLoader

Register Level->registerChunkLoader($this, $chunkX, $chunkZ) Unregister Level->unregisterChunkLoader($this, $chunkX, $chunkZ) WARNING: When moving this object around in the world or destroying it, be sure to free the existing references from Level, otherwise you'll leak memory.
Show file Open project: ClearSkyTeam/ClearSky Interface Usage Examples

Public Methods

Method Description
getLevel ( ) : Level
getLoaderId ( ) : integer Returns the ChunkLoader id.
getPosition ( ) : Position
getX ( ) : float
getZ ( ) : float
isLoaderActive ( ) : boolean Returns if the chunk loader is currently active
onBlockChanged ( Vector3 $block ) This method will be called when a block changes in a registered chunk
onChunkChanged ( pocketmine\level\format\FullChunk $chunk ) This method will be called when a Chunk is replaced by a new one
onChunkLoaded ( pocketmine\level\format\FullChunk $chunk ) This method will be called when a registered chunk is loaded
onChunkPopulated ( pocketmine\level\format\FullChunk $chunk ) This method will be called when a registered chunk is populated Usually it'll be sent with another call to onChunkChanged()
onChunkUnloaded ( pocketmine\level\format\FullChunk $chunk ) This method will be called when a registered chunk is unloaded

Method Details

getLevel() public method

public getLevel ( ) : Level
return Level

getLoaderId() public method

Call Level::generateChunkLoaderId($this) to generate and save it
public getLoaderId ( ) : integer
return integer

getPosition() public method

public getPosition ( ) : Position
return Position

getX() public method

public getX ( ) : float
return float

getZ() public method

public getZ ( ) : float
return float

isLoaderActive() public method

Returns if the chunk loader is currently active
public isLoaderActive ( ) : boolean
return boolean

onBlockChanged() public method

This method will be called when a block changes in a registered chunk
public onBlockChanged ( Vector3 $block )
$block pocketmine\math\Vector3

onChunkChanged() public method

This method will be called when a Chunk is replaced by a new one
public onChunkChanged ( pocketmine\level\format\FullChunk $chunk )
$chunk pocketmine\level\format\FullChunk

onChunkLoaded() public method

This method will be called when a registered chunk is loaded
public onChunkLoaded ( pocketmine\level\format\FullChunk $chunk )
$chunk pocketmine\level\format\FullChunk

onChunkPopulated() public method

This method will be called when a registered chunk is populated Usually it'll be sent with another call to onChunkChanged()
public onChunkPopulated ( pocketmine\level\format\FullChunk $chunk )
$chunk pocketmine\level\format\FullChunk

onChunkUnloaded() public method

This method will be called when a registered chunk is unloaded
public onChunkUnloaded ( pocketmine\level\format\FullChunk $chunk )
$chunk pocketmine\level\format\FullChunk