mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-22 05:24:39 +00:00
Fixed update ticks
This commit is contained in:
parent
279a438ae6
commit
0e36107878
@ -164,7 +164,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->server->getGenerationManager()->openLevel($this, $generator, $this->provider->getGeneratorOptions());
|
$this->server->getGenerationManager()->openLevel($this, $generator, $this->provider->getGeneratorOptions());
|
||||||
|
|
||||||
$this->folderName = $name;
|
$this->folderName = $name;
|
||||||
|
$this->updateQueue = new ReversePriorityQueue();
|
||||||
$this->startTime = $this->time = (int) $this->provider->getTime();
|
$this->startTime = $this->time = (int) $this->provider->getTime();
|
||||||
$this->nextSave = $this->startCheck = microtime(true);
|
$this->nextSave = $this->startCheck = microtime(true);
|
||||||
$this->nextSave = microtime(true) + 90;
|
$this->nextSave = microtime(true) + 90;
|
||||||
@ -376,6 +376,8 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->changedBlocks = [];
|
$this->changedBlocks = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$X = null;
|
$X = null;
|
||||||
$Z = null;
|
$Z = null;
|
||||||
|
|
||||||
@ -383,6 +385,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
while($this->updateQueue->count() > 0 and $this->updateQueue->current()["priority"] <= $currentTick){
|
while($this->updateQueue->count() > 0 and $this->updateQueue->current()["priority"] <= $currentTick){
|
||||||
$block = $this->getBlock($this->updateQueue->extract()["data"]);
|
$block = $this->getBlock($this->updateQueue->extract()["data"]);
|
||||||
$block->onUpdate(self::BLOCK_UPDATE_SCHEDULED);
|
$block->onUpdate(self::BLOCK_UPDATE_SCHEDULED);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->usedChunks as $index => $p){
|
foreach($this->usedChunks as $index => $p){
|
||||||
@ -400,7 +403,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if($this->nextSave < microtime(true)){
|
if($this->nextSave < microtime(true)){
|
||||||
$X = null;
|
$X = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user