Calculate skylight on chunk population

This commit is contained in:
Shoghi Cervantes
2015-05-06 16:57:49 +02:00
parent 44b5c23ee1
commit fb03df3d06
6 changed files with 72 additions and 4 deletions

View File

@ -272,6 +272,9 @@ class Chunk extends BaseFullChunk{
if($flags & 0x02){
$chunk->setPopulated();
}
if($flags & 0x04){
$chunk->setLightPopulated();
}
return $chunk;
}catch(\Exception $e){
return null;
@ -333,7 +336,7 @@ class Chunk extends BaseFullChunk{
$this->getBlockLightArray() .
$heightmap .
$biomeColors . chr(
($this->isPopulated() ? 0x02 : 0) | ($this->isGenerated() ? 0x01 : 0)
($this->isLightPopulated() ? 0x04 : 0) | ($this->isPopulated() ? 0x02 : 0) | ($this->isGenerated() ? 0x01 : 0)
);
}
}