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:
Dylan K. Taylor 2020-10-27 18:42:30 +00:00
parent 1859dac789
commit 797e0996f4

View File

@ -61,10 +61,10 @@ class PopulationTask extends AsyncTask{
public function __construct(World $world, Chunk $chunk){
$this->state = true;
$this->worldId = $world->getId();
$this->chunk = FastChunkSerializer::serialize($chunk);
$this->chunk = FastChunkSerializer::serializeWithoutLight($chunk);
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);
@ -117,10 +117,10 @@ class PopulationTask extends AsyncTask{
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
$chunk->setPopulated();
$this->chunk = FastChunkSerializer::serialize($chunk);
$this->chunk = FastChunkSerializer::serializeWithoutLight($chunk);
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();