Added Empty chunk detection

This commit is contained in:
Shoghi Cervantes
2014-06-22 22:29:46 +02:00
parent 36cdfd969d
commit 6f9becdbb3
3 changed files with 14 additions and 7 deletions

View File

@ -233,7 +233,11 @@ abstract class BaseChunk implements Chunk{
}
public function setSection($fY, ChunkSection $section){
$this->sections[(int) $fY] = $section;
if(substr_count($section->getIdArray(), "\x00") === 4096 and substr_count($section->getDataArray(), "\x00") === 2048){
$this->sections[(int) $fY] = new EmptyChunkSection($fY);
}else{
$this->sections[(int) $fY] = $section;
}
}
public function addEntity(Entity $entity){