mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Level: Do level provider GC every 5 minutes from level tick
this should solve #1183, pending further testing.
This commit is contained in:
parent
50f273c041
commit
1e139743b8
@ -146,6 +146,8 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
/** @var LevelProvider */
|
/** @var LevelProvider */
|
||||||
private $provider;
|
private $provider;
|
||||||
|
/** @var int */
|
||||||
|
private $providerGarbageCollectionTicker = 0;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $worldHeight;
|
private $worldHeight;
|
||||||
@ -720,6 +722,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->unloadChunks();
|
$this->unloadChunks();
|
||||||
|
if(++$this->providerGarbageCollectionTicker >= 6000){
|
||||||
|
$this->provider->doGarbageCollection();
|
||||||
|
$this->providerGarbageCollectionTicker = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//Do block updates
|
//Do block updates
|
||||||
$this->timings->doTickPending->startTiming();
|
$this->timings->doTickPending->startTiming();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user