Rename Chunk::getSubChunkChecked() -> getSubChunk()

This commit is contained in:
Dylan K. Taylor
2020-10-31 23:12:03 +00:00
parent e09d78238f
commit 4549522289
7 changed files with 16 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ final class ChunkSerializer{
*/
public static function getSubChunkCount(Chunk $chunk) : int{
for($count = $chunk->getSubChunks()->count(); $count > 0; --$count){
if($chunk->getSubChunkChecked($count - 1)->isEmptyFast()){
if($chunk->getSubChunk($count - 1)->isEmptyFast()){
continue;
}
return $count;
@@ -56,7 +56,7 @@ final class ChunkSerializer{
$stream = new PacketSerializer();
$subChunkCount = self::getSubChunkCount($chunk);
for($y = 0; $y < $subChunkCount; ++$y){
$layers = $chunk->getSubChunkChecked($y)->getBlockLayers();
$layers = $chunk->getSubChunk($y)->getBlockLayers();
$stream->putByte(8); //version
$stream->putByte(count($layers));