Improved chunk serialization

This commit is contained in:
Shoghi Cervantes
2014-08-01 13:20:12 +02:00
parent 81feff6d0d
commit c1846e3bcf
3 changed files with 29 additions and 9 deletions

View File

@ -160,6 +160,9 @@ class Chunk extends BaseChunk{
$nbt->Sections = new Enum("Sections", []);
$nbt->Sections->setTagType(NBT::TAG_Compound);
foreach($this->getSections() as $section){
if($section instanceof EmptyChunkSection){
continue;
}
$nbt->Sections[$section->getY()] = new Compound(null, [
"Y" => new Byte("Y", $section->getY()),
"Blocks" => new ByteArray("Blocks", $section->getIdArray()),