mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Revert "fix race condition between chunk generation and light population"
This reverts commit 80747814fb769d5cbed2ea6a351ef218c9f9b0c9.
This commit is contained in:
parent
13de99315b
commit
ce77e283ab
@ -2483,7 +2483,6 @@ class World implements ChunkManager{
|
|||||||
(new ChunkLoadEvent($this, $chunk, !$chunk->isGenerated()))->call();
|
(new ChunkLoadEvent($this, $chunk, !$chunk->isGenerated()))->call();
|
||||||
|
|
||||||
if(!$chunk->isLightPopulated() and $chunk->isPopulated()){
|
if(!$chunk->isLightPopulated() and $chunk->isPopulated()){
|
||||||
$this->lockChunk($x, $z);
|
|
||||||
$this->getServer()->getAsyncPool()->submitTask(new LightPopulationTask($this, $chunk));
|
$this->getServer()->getAsyncPool()->submitTask(new LightPopulationTask($this, $chunk));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2739,12 +2738,6 @@ class World implements ChunkManager{
|
|||||||
if(isset($this->chunkPopulationQueue[$index = World::chunkHash($x, $z)]) or (count($this->chunkPopulationQueue) >= $this->chunkPopulationQueueSize and !$force)){
|
if(isset($this->chunkPopulationQueue[$index = World::chunkHash($x, $z)]) or (count($this->chunkPopulationQueue) >= $this->chunkPopulationQueueSize and !$force)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$chunk = $this->getChunk($x, $z, true);
|
|
||||||
if(!$chunk->isPopulated()){
|
|
||||||
Timings::$populationTimer->startTiming();
|
|
||||||
|
|
||||||
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($x + $xx, $z + $zz)){
|
if($this->isChunkLocked($x + $xx, $z + $zz)){
|
||||||
@ -2753,6 +2746,10 @@ class World implements ChunkManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$chunk = $this->getChunk($x, $z, true);
|
||||||
|
if(!$chunk->isPopulated()){
|
||||||
|
Timings::$populationTimer->startTiming();
|
||||||
|
|
||||||
$this->chunkPopulationQueue[$index] = true;
|
$this->chunkPopulationQueue[$index] = true;
|
||||||
for($xx = -1; $xx <= 1; ++$xx){
|
for($xx = -1; $xx <= 1; ++$xx){
|
||||||
for($zz = -1; $zz <= 1; ++$zz){
|
for($zz = -1; $zz <= 1; ++$zz){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user