PocketMine
ChunkLoader Interface Reference
Inheritance diagram for ChunkLoader:
Player

Public Member Functions

 getLoaderId ()
 
 isLoaderActive ()
 
 getPosition ()
 
 getX ()
 
 getZ ()
 
 getLevel ()
 
 onChunkChanged (FullChunk $chunk)
 
 onChunkLoaded (FullChunk $chunk)
 
 onChunkUnloaded (FullChunk $chunk)
 
 onChunkPopulated (FullChunk $chunk)
 
 onBlockChanged (Vector3 $block)
 

Detailed Description

If you want to keep chunks loaded and receive notifications on a specific area, extend this class and register it into Level. This will also tick chunks.

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.

Member Function Documentation

getLevel ( )
Returns
Level
getLoaderId ( )

Returns the ChunkLoader id. Call Level::generateChunkLoaderId($this) to generate and save it

Returns
int

Implemented in Player.

getPosition ( )
Returns
Position
getX ( )
Returns
float
getZ ( )
Returns
float
isLoaderActive ( )

Returns if the chunk loader is currently active

Returns
bool

Implemented in Player.

onBlockChanged ( Vector3  $block)

This method will be called when a block changes in a registered chunk

Parameters
Block | Vector3$block

Implemented in Player.

onChunkChanged ( FullChunk  $chunk)

This method will be called when a Chunk is replaced by a new one

Parameters
FullChunk$chunk

Implemented in Player.

onChunkLoaded ( FullChunk  $chunk)

This method will be called when a registered chunk is loaded

Parameters
FullChunk$chunk

Implemented in Player.

onChunkPopulated ( FullChunk  $chunk)

This method will be called when a registered chunk is populated Usually it'll be sent with another call to onChunkChanged()

Parameters
FullChunk$chunk

Implemented in Player.

onChunkUnloaded ( FullChunk  $chunk)

This method will be called when a registered chunk is unloaded

Parameters
FullChunk$chunk

Implemented in Player.


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