mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +00:00
PopulationTask: Do not include light when serializing chunks (either way)
non-populated chunks shouldn't be light-populated anyway, but in some cases they are (bug or plugin interference). chunks which were already populated might get modified by adjacent chunk populations, which should invalidate their lighting because generation doesn't track which blocks were changed, so the whole chunk should be recalculated.
This commit is contained in:
parent
1859dac789
commit
797e0996f4
@ -61,10 +61,10 @@ class PopulationTask extends AsyncTask{
|
|||||||
public function __construct(World $world, Chunk $chunk){
|
public function __construct(World $world, Chunk $chunk){
|
||||||
$this->state = true;
|
$this->state = true;
|
||||||
$this->worldId = $world->getId();
|
$this->worldId = $world->getId();
|
||||||
$this->chunk = FastChunkSerializer::serialize($chunk);
|
$this->chunk = FastChunkSerializer::serializeWithoutLight($chunk);
|
||||||
|
|
||||||
foreach($world->getAdjacentChunks($chunk->getX(), $chunk->getZ()) as $i => $c){
|
foreach($world->getAdjacentChunks($chunk->getX(), $chunk->getZ()) as $i => $c){
|
||||||
$this->{"chunk$i"} = $c !== null ? FastChunkSerializer::serialize($c) : null;
|
$this->{"chunk$i"} = $c !== null ? FastChunkSerializer::serializeWithoutLight($c) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->storeLocal(self::TLS_KEY_WORLD, $world);
|
$this->storeLocal(self::TLS_KEY_WORLD, $world);
|
||||||
@ -117,10 +117,10 @@ class PopulationTask extends AsyncTask{
|
|||||||
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
||||||
$chunk->setPopulated();
|
$chunk->setPopulated();
|
||||||
|
|
||||||
$this->chunk = FastChunkSerializer::serialize($chunk);
|
$this->chunk = FastChunkSerializer::serializeWithoutLight($chunk);
|
||||||
|
|
||||||
foreach($chunks as $i => $c){
|
foreach($chunks as $i => $c){
|
||||||
$this->{"chunk$i"} = $c->isDirty() ? FastChunkSerializer::serialize($c) : null;
|
$this->{"chunk$i"} = $c->isDirty() ? FastChunkSerializer::serializeWithoutLight($c) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$manager->cleanChunks();
|
$manager->cleanChunks();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user