mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fixed canUseChunkCache() logic (#1446)
Fix setting disable chunk cache on low memory being useless, fix chunk cache not working if low memory cache clear is enabled
This commit is contained in:
parent
4dfd171af0
commit
bf68a6a9fc
@ -72,7 +72,7 @@ class MemoryManager{
|
||||
private $chunkTrigger;
|
||||
|
||||
/** @var bool */
|
||||
private $chunkCache;
|
||||
private $disableChunkCacheOnLowMemory;
|
||||
/** @var bool */
|
||||
private $cacheTrigger;
|
||||
|
||||
@ -133,7 +133,7 @@ class MemoryManager{
|
||||
$this->chunkCollect = (bool) $this->server->getProperty("memory.max-chunks.trigger-chunk-collect", true);
|
||||
$this->chunkTrigger = (bool) $this->server->getProperty("memory.max-chunks.low-memory-trigger", true);
|
||||
|
||||
$this->chunkCache = (bool) $this->server->getProperty("memory.world-caches.disable-chunk-cache", true);
|
||||
$this->disableChunkCacheOnLowMemory = (bool) $this->server->getProperty("memory.world-caches.disable-chunk-cache", true);
|
||||
$this->cacheTrigger = (bool) $this->server->getProperty("memory.world-caches.low-memory-trigger", true);
|
||||
|
||||
$this->dumpWorkers = (bool) $this->server->getProperty("memory.memory-dump.dump-async-worker", true);
|
||||
@ -151,7 +151,7 @@ class MemoryManager{
|
||||
* @return bool
|
||||
*/
|
||||
public function canUseChunkCache() : bool{
|
||||
return !($this->lowMemory and $this->chunkTrigger);
|
||||
return !$this->lowMemory or !$this->disableChunkCacheOnLowMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user