Implemented sky light generation-time population and updating, obsolete and close #160

This commit is contained in:
Dylan K. Taylor
2017-04-18 13:05:01 +01:00
parent 5e6a0e7ba0
commit dab73d8950
13 changed files with 417 additions and 154 deletions

View File

@ -48,14 +48,8 @@ class PopulationTask extends AsyncTask{
$this->levelId = $level->getId();
$this->chunk = $chunk->fastSerialize();
for($i = 0; $i < 9; ++$i){
if($i === 4){
continue;
}
$xx = -1 + $i % 3;
$zz = -1 + (int) ($i / 3);
$ck = $level->getChunk($chunk->getX() + $xx, $chunk->getZ() + $zz, false);
$this->{"chunk$i"} = $ck !== null ? $ck->fastSerialize() : null;
foreach($level->getAdjacentChunks($chunk->getX(), $chunk->getZ()) as $i => $c){
$this->{"chunk$i"} = $c !== null ? $c->fastSerialize() : null;
}
}
@ -173,4 +167,4 @@ class PopulationTask extends AsyncTask{
$level->generateChunkCallback($chunk->getX(), $chunk->getZ(), $chunk);
}
}
}
}