From 797e0996f4ce8af85e52d51714b77ea0ec0269eb Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 27 Oct 2020 18:42:30 +0000 Subject: [PATCH] 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. --- src/world/generator/PopulationTask.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/world/generator/PopulationTask.php b/src/world/generator/PopulationTask.php index a35197084..2ead5ece6 100644 --- a/src/world/generator/PopulationTask.php +++ b/src/world/generator/PopulationTask.php @@ -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();