World: fixed generation requests being rejected during resolution

when a chunk population is ordered, its only chunk loader is the one that the World installed to keep the chunk loaded while it was generated. So, when the resolver removes its chunk loader from the chunk, it triggers the chunk unloading mechanism, which causes the promise to directly be rejected.
This commit is contained in:
Dylan K. Taylor 2021-05-10 17:20:04 +01:00
parent f909557529
commit 0ff21557e4
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -2111,8 +2111,9 @@ class World implements ChunkManager{
}
}
unset($this->activeChunkPopulationTasks[$index]);
$this->chunkPopulationRequestMap[$index]->resolve($chunk);
$promise = $this->chunkPopulationRequestMap[$index];
unset($this->chunkPopulationRequestMap[$index]);
$promise->resolve($chunk);
$this->drainPopulationRequestQueue();
}elseif($this->isChunkLocked($x, $z)){