mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
World: make sure that chunks locked by PopulationTask always get unlocked, no matter what
fixes #4527
This commit is contained in:
parent
32a857b8b4
commit
1775699f05
@ -2908,21 +2908,17 @@ class World implements ChunkManager{
|
||||
public function generateChunkCallback(ChunkLockId $chunkLockId, int $x, int $z, Chunk $chunk, array $adjacentChunks, ChunkLoader $temporaryChunkLoader) : void{
|
||||
Timings::$generationCallback->startTiming();
|
||||
|
||||
$dirtyChunks = 0;
|
||||
for($xx = -1; $xx <= 1; ++$xx){
|
||||
for($zz = -1; $zz <= 1; ++$zz){
|
||||
$this->unregisterChunkLoader($temporaryChunkLoader, $x + $xx, $z + $zz);
|
||||
if(!$this->unlockChunk($x + $xx, $z + $zz, $chunkLockId)){
|
||||
$dirtyChunks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($this->chunkPopulationRequestMap[$index = World::chunkHash($x, $z)]) && isset($this->activeChunkPopulationTasks[$index])){
|
||||
$dirtyChunks = 0;
|
||||
for($xx = -1; $xx <= 1; ++$xx){
|
||||
for($zz = -1; $zz <= 1; ++$zz){
|
||||
if(!$this->unlockChunk($x + $xx, $z + $zz, $chunkLockId)){
|
||||
$dirtyChunks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($dirtyChunks === 0){
|
||||
$oldChunk = $this->loadChunk($x, $z);
|
||||
$this->setChunk($x, $z, $chunk);
|
||||
|
Loading…
x
Reference in New Issue
Block a user