Merge commit '60b26a7ea8939a85db9af0a99dd5a4b13e1a562d'

# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
This commit is contained in:
Dylan K. Taylor 2020-06-26 19:16:53 +01:00
commit 05bd92a94b

View File

@ -222,9 +222,9 @@ class PacketSerializer extends BinaryStream{
/** @var CompoundTag|null $compound */
$compound = null;
if($nbtLen === 0xffff){
$c = $this->getByte();
if($c !== 1){
throw new PacketDecodeException("Unexpected NBT count $c");
$nbtDataVersion = $this->getByte();
if($nbtDataVersion !== 1){
throw new PacketDecodeException("Unexpected NBT data version $nbtDataVersion");
}
$compound = $this->getNbtCompoundRoot();
}elseif($nbtLen !== 0){
@ -263,7 +263,7 @@ class PacketSerializer extends BinaryStream{
$nbt = $item->getNbt();
if($nbt !== null){
$this->putLShort(0xffff);
$this->putByte(1); //TODO: some kind of count field? always 1 as of 1.9.0
$this->putByte(1); //TODO: NBT data version (?)
$this->put((new NetworkNbtSerializer())->write(new TreeRoot($nbt)));
}else{
$this->putLShort(0);