mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
parent
9980a0780a
commit
f140fef52d
@ -141,8 +141,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
/** @var Chunk[] */
|
/** @var Chunk[] */
|
||||||
protected $unloadQueue;
|
protected $unloadQueue;
|
||||||
|
|
||||||
protected $nextSave;
|
|
||||||
|
|
||||||
protected $time;
|
protected $time;
|
||||||
public $stopTime;
|
public $stopTime;
|
||||||
|
|
||||||
@ -254,7 +252,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->updateQueue = new ReversePriorityQueue();
|
$this->updateQueue = new ReversePriorityQueue();
|
||||||
$this->updateQueue->setExtractFlags(\SplPriorityQueue::EXTR_BOTH);
|
$this->updateQueue->setExtractFlags(\SplPriorityQueue::EXTR_BOTH);
|
||||||
$this->time = (int) $this->provider->getTime();
|
$this->time = (int) $this->provider->getTime();
|
||||||
$this->nextSave = microtime(true) + 90;
|
|
||||||
|
|
||||||
$this->chunkTickRadius = min($this->server->getViewDistance(), max(1, (int) $this->server->getProperty("chunk-ticking.tick-radius", 3)));
|
$this->chunkTickRadius = min($this->server->getViewDistance(), max(1, (int) $this->server->getProperty("chunk-ticking.tick-radius", 3)));
|
||||||
$this->chunksPerTick = (int) $this->server->getProperty("chunk-ticking.per-tick", 80);
|
$this->chunksPerTick = (int) $this->server->getProperty("chunk-ticking.per-tick", 80);
|
||||||
@ -296,7 +293,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if($this->getAutoSave()){
|
if($this->getAutoSave()){
|
||||||
$this->provider->saveChunks();
|
$this->save();
|
||||||
}
|
}
|
||||||
$this->provider->close();
|
$this->provider->close();
|
||||||
}
|
}
|
||||||
@ -337,7 +334,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->server->getLogger()->info("Unloading level \"" . $this->getName() . "\"");
|
$this->server->getLogger()->info("Unloading level \"" . $this->getName() . "\"");
|
||||||
$this->nextSave = PHP_INT_MAX;
|
|
||||||
$defaultLevel = $this->server->getDefaultLevel();
|
$defaultLevel = $this->server->getDefaultLevel();
|
||||||
foreach($this->getPlayers() as $player){
|
foreach($this->getPlayers() as $player){
|
||||||
if($this === $defaultLevel or $defaultLevel === null){
|
if($this === $defaultLevel or $defaultLevel === null){
|
||||||
@ -658,7 +654,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
if($this->provider instanceof BaseLevelProvider){
|
if($this->provider instanceof BaseLevelProvider){
|
||||||
$this->provider->saveLevelData();
|
$this->provider->saveLevelData();
|
||||||
}
|
}
|
||||||
$this->nextSave = microtime(true) + 45;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user