Level: Do level provider GC every 5 minutes from level tick

this should solve #1183, pending further testing.
This commit is contained in:
Dylan K. Taylor 2018-01-02 10:23:57 +00:00
parent 50f273c041
commit 1e139743b8

View File

@ -146,6 +146,8 @@ class Level implements ChunkManager, Metadatable{
/** @var LevelProvider */
private $provider;
/** @var int */
private $providerGarbageCollectionTicker = 0;
/** @var int */
private $worldHeight;
@ -720,6 +722,10 @@ class Level implements ChunkManager, Metadatable{
}
$this->unloadChunks();
if(++$this->providerGarbageCollectionTicker >= 6000){
$this->provider->doGarbageCollection();
$this->providerGarbageCollectionTicker = 0;
}
//Do block updates
$this->timings->doTickPending->startTiming();