Add missing byte, fix network sending issues, partly fixes #227

This commit is contained in:
Dylan K. Taylor 2017-01-03 17:39:27 +00:00
parent 0bd7ea211d
commit 8a29e77f5e
2 changed files with 3 additions and 3 deletions

View File

@ -108,10 +108,10 @@ class EmptySubChunk extends SubChunk{
}
public function networkSerialize() : string{
return str_repeat("\x00", 10240);
return "\x00" . str_repeat("\x00", 10240);
}
public function fastSerialize() : string{
return "";
throw new \BadMethodCallException("Should not try to serialize empty subchunks");
}
}

View File

@ -628,7 +628,7 @@ class GenericChunk implements Chunk{
$count = 0;
$subChunks = "";
foreach($chunk->subChunks as $y => $subChunk){
if($subChunk->isEmpty()){
if($subChunk instanceof EmptySubChunk){
continue;
}
++$count;