performance: only calculate light for chunks inside ticking areas

this produces a major performance improvement for large render distances, and reduces the impact of lighting calculation to zero on servers which have random blockupdates turned off.
This commit is contained in:
Dylan K. Taylor
2020-09-26 13:13:12 +01:00
parent b727972c76
commit 89cce4c749
4 changed files with 12 additions and 9 deletions

View File

@ -59,7 +59,7 @@ final class FastChunkSerializer{
* TODO: tiles and entities
*/
public static function serialize(Chunk $chunk, bool $includeLight = true) : string{
$includeLight = $includeLight && $chunk->isLightPopulated();
$includeLight = $includeLight && $chunk->isLightPopulated() === true;
$stream = new BinaryStream();
$stream->putInt($chunk->getX());