PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
pocketmine\network\mcpe\cache\ChunkCache Class Reference
+ Inheritance diagram for pocketmine\network\mcpe\cache\ChunkCache:
+ Collaboration diagram for pocketmine\network\mcpe\cache\ChunkCache:

Public Member Functions

 calculateCacheSize ()
 
 getHitPercentage ()
 
 onBlockChanged (Vector3 $block)
 
onBlockChanged as onChunkUnloaded as onChunkChanged (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkLoaded (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkPopulated (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkUnloaded (int $chunkX, int $chunkZ, Chunk $chunk)
 
 request (int $chunkX, int $chunkZ)
 

Static Public Member Functions

static getInstance (World $world, Compressor $compressor)
 
static pruneCaches ()
 

Detailed Description

This class is used by the current MCPE protocol system to store cached chunk packets for fast resending.

Definition at line 41 of file ChunkCache.php.

Member Function Documentation

◆ calculateCacheSize()

pocketmine\network\mcpe\cache\ChunkCache::calculateCacheSize ( )

Returns the number of bytes occupied by the cache data in this cache. This does not include the size of any promises referenced by the cache.

Definition at line 199 of file ChunkCache.php.

◆ getHitPercentage()

pocketmine\network\mcpe\cache\ChunkCache::getHitPercentage ( )

Returns the percentage of requests to the cache which resulted in a cache hit.

Definition at line 212 of file ChunkCache.php.

◆ getInstance()

static pocketmine\network\mcpe\cache\ChunkCache::getInstance ( World $world,
Compressor $compressor )
static

Fetches the ChunkCache instance for the given world. This lazily creates cache systems as needed.

Definition at line 48 of file ChunkCache.php.

◆ onBlockChanged()

pocketmine\network\mcpe\cache\ChunkCache::onBlockChanged ( Vector3 $block)
See also
ChunkListener::onBlockChanged()

Implements pocketmine\world\ChunkListener.

Definition at line 181 of file ChunkCache.php.

◆ onChunkChanged()

onBlockChanged as onChunkUnloaded as pocketmine\network\mcpe\cache\ChunkCache::onChunkChanged ( int $chunkX,
int $chunkZ,
Chunk $chunk )
See also
ChunkListener::onChunkChanged()

Implements pocketmine\world\ChunkListener.

Definition at line 174 of file ChunkCache.php.

◆ onChunkLoaded()

pocketmine\world\ChunkListener::onChunkLoaded ( int $chunkX,
int $chunkZ,
Chunk $chunk )
inherited

This method will be called when a registered chunk is loaded

◆ onChunkPopulated()

pocketmine\world\ChunkListener::onChunkPopulated ( int $chunkX,
int $chunkZ,
Chunk $chunk )
inherited

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

◆ onChunkUnloaded()

pocketmine\network\mcpe\cache\ChunkCache::onChunkUnloaded ( int $chunkX,
int $chunkZ,
Chunk $chunk )
See also
ChunkListener::onChunkUnloaded()

Implements pocketmine\world\ChunkListener.

Definition at line 190 of file ChunkCache.php.

◆ pruneCaches()

static pocketmine\network\mcpe\cache\ChunkCache::pruneCaches ( )
static

Definition at line 68 of file ChunkCache.php.

◆ request()

pocketmine\network\mcpe\cache\ChunkCache::request ( int $chunkX,
int $chunkZ )

Requests asynchronous preparation of the chunk at the given coordinates.

Returns
CompressBatchPromise a promise of resolution which will contain a compressed chunk packet.

Definition at line 100 of file ChunkCache.php.


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