Updated leveldb implementation to support MCPE 1.1 worlds

This commit is contained in:
Dylan K. Taylor
2017-06-30 09:11:26 +01:00
parent 56dfa7d000
commit 70bd9afd37
12 changed files with 193 additions and 104 deletions

View File

@ -46,11 +46,13 @@ class SubChunk implements SubChunkInterface{
self::assignData($this->blockLight, $blockLight, 2048);
}
public function isEmpty() : bool{
public function isEmpty(bool $checkLight = true) : bool{
return (
substr_count($this->ids, "\x00") === 4096 and
substr_count($this->skyLight, "\xff") === 2048 and
substr_count($this->blockLight, "\x00") === 2048
(!$checkLight or (
substr_count($this->skyLight, "\xff") === 2048 and
substr_count($this->blockLight, "\x00") === 2048
))
);
}