mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 18:41:47 +00:00
World: check population locks _after_ checking if the chunk is already populated, not before
this led to another case where a population request would be queued up for an already-populated chunk for no reason.
This commit is contained in:
parent
f4a3c40b5c
commit
8f803df511
@ -2836,6 +2836,13 @@ class World implements ChunkManager{
|
||||
//generation is already running
|
||||
return $resolver->getPromise();
|
||||
}
|
||||
|
||||
$temporaryChunkLoader = new class implements ChunkLoader{};
|
||||
$this->registerChunkLoader($temporaryChunkLoader, $chunkX, $chunkZ);
|
||||
$chunk = $this->loadChunk($chunkX, $chunkZ);
|
||||
if($chunk === null || !$chunk->isPopulated()){
|
||||
Timings::$population->startTiming();
|
||||
|
||||
for($xx = -1; $xx <= 1; ++$xx){
|
||||
for($zz = -1; $zz <= 1; ++$zz){
|
||||
if($this->isChunkLocked($chunkX + $xx, $chunkZ + $zz)){
|
||||
@ -2845,12 +2852,6 @@ class World implements ChunkManager{
|
||||
}
|
||||
}
|
||||
|
||||
$temporaryChunkLoader = new class implements ChunkLoader{};
|
||||
$this->registerChunkLoader($temporaryChunkLoader, $chunkX, $chunkZ);
|
||||
$chunk = $this->loadChunk($chunkX, $chunkZ);
|
||||
if($chunk === null || !$chunk->isPopulated()){
|
||||
Timings::$population->startTiming();
|
||||
|
||||
$this->activeChunkPopulationTasks[$chunkHash] = true;
|
||||
if($resolver === null){
|
||||
$resolver = new PromiseResolver();
|
||||
|
Loading…
x
Reference in New Issue
Block a user