mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Expand height range to include -64 to 320
This commit is contained in:
@ -41,8 +41,6 @@ use function count;
|
||||
use function str_repeat;
|
||||
|
||||
final class ChunkSerializer{
|
||||
public const LOWER_PADDING_SIZE = 4;
|
||||
|
||||
private function __construct(){
|
||||
//NOOP
|
||||
}
|
||||
@ -65,12 +63,6 @@ final class ChunkSerializer{
|
||||
public static function serializeFullChunk(Chunk $chunk, RuntimeBlockMapping $blockMapper, PacketSerializerContext $encoderContext, ?string $tiles = null) : string{
|
||||
$stream = PacketSerializer::encoder($encoderContext);
|
||||
|
||||
//TODO: HACK! fill in fake subchunks to make up for the new negative space client-side
|
||||
for($y = 0; $y < self::LOWER_PADDING_SIZE; $y++){
|
||||
$stream->putByte(8); //subchunk version 8
|
||||
$stream->putByte(0); //0 layers - client will treat this as all-air
|
||||
}
|
||||
|
||||
$subChunkCount = self::getSubChunkCount($chunk);
|
||||
for($y = Chunk::MIN_SUBCHUNK_INDEX, $writtenCount = 0; $writtenCount < $subChunkCount; ++$y, ++$writtenCount){
|
||||
self::serializeSubChunk($chunk->getSubChunk($y), $blockMapper, $stream, false);
|
||||
|
Reference in New Issue
Block a user