PocketMine-MP 5.23.3 git-976fc63567edab7a6fb6aeae739f43cf9fe57de4
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 42 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 210 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 223 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 49 of file ChunkCache.php.

◆ onBlockChanged()

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

Implements pocketmine\world\ChunkListener.

Definition at line 192 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 185 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 201 of file ChunkCache.php.

◆ pruneCaches()

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

Definition at line 69 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|string Compressed chunk packet, or a promise for one to be resolved asynchronously.

Definition at line 137 of file ChunkCache.php.


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