mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
World: fixed population timer sometimes not being stopped
This commit is contained in:
parent
b574d49d36
commit
efdd7a186d
@ -3118,6 +3118,7 @@ class World implements ChunkManager{
|
|||||||
|
|
||||||
Timings::$population->startTiming();
|
Timings::$population->startTiming();
|
||||||
|
|
||||||
|
try{
|
||||||
for($xx = -1; $xx <= 1; ++$xx){
|
for($xx = -1; $xx <= 1; ++$xx){
|
||||||
for($zz = -1; $zz <= 1; ++$zz){
|
for($zz = -1; $zz <= 1; ++$zz){
|
||||||
if($this->isChunkLocked($chunkX + $xx, $chunkZ + $zz)){
|
if($this->isChunkLocked($chunkX + $xx, $chunkZ + $zz)){
|
||||||
@ -3135,7 +3136,8 @@ class World implements ChunkManager{
|
|||||||
|
|
||||||
$chunkPopulationLockId = new ChunkLockId();
|
$chunkPopulationLockId = new ChunkLockId();
|
||||||
|
|
||||||
$temporaryChunkLoader = new class implements ChunkLoader{};
|
$temporaryChunkLoader = new class implements ChunkLoader{
|
||||||
|
};
|
||||||
for($xx = -1; $xx <= 1; ++$xx){
|
for($xx = -1; $xx <= 1; ++$xx){
|
||||||
for($zz = -1; $zz <= 1; ++$zz){
|
for($zz = -1; $zz <= 1; ++$zz){
|
||||||
$this->lockChunk($chunkX + $xx, $chunkZ + $zz, $chunkPopulationLockId);
|
$this->lockChunk($chunkX + $xx, $chunkZ + $zz, $chunkPopulationLockId);
|
||||||
@ -3169,8 +3171,10 @@ class World implements ChunkManager{
|
|||||||
}
|
}
|
||||||
$this->workerPool->submitTaskToWorker($task, $workerId);
|
$this->workerPool->submitTaskToWorker($task, $workerId);
|
||||||
|
|
||||||
Timings::$population->stopTiming();
|
|
||||||
return $resolver->getPromise();
|
return $resolver->getPromise();
|
||||||
|
}finally{
|
||||||
|
Timings::$population->stopTiming();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user