mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Fixed extra data encoding
This commit is contained in:
parent
d74486a64a
commit
a0cda3b45a
@ -619,9 +619,16 @@ class GenericChunk implements Chunk{
|
|||||||
$result .= $this->subChunks[$y]->networkSerialize();
|
$result .= $this->subChunks[$y]->networkSerialize();
|
||||||
}
|
}
|
||||||
$result .= pack("v*", ...$this->heightMap)
|
$result .= pack("v*", ...$this->heightMap)
|
||||||
. $this->biomeIds
|
. $this->biomeIds
|
||||||
. "\x00" //border block array count (TODO)
|
. chr(0); //border block array count (TODO)
|
||||||
. "\x00\x00\x00\x00"; //extra data array (TODO)
|
|
||||||
|
$extraData = new BinaryStream();
|
||||||
|
$extraData->putVarInt(count($this->extraData)); //WHY, Mojang, WHY
|
||||||
|
foreach($this->extraData as $key => $value){
|
||||||
|
$extraData->putVarInt($key);
|
||||||
|
$extraData->putLShort($value);
|
||||||
|
}
|
||||||
|
$result .= $extraData->getBuffer();
|
||||||
|
|
||||||
if(count($this->tiles) > 0){
|
if(count($this->tiles) > 0){
|
||||||
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user