mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 14:19:53 +00:00
Merge commit '60b26a7ea8939a85db9af0a99dd5a4b13e1a562d'
# Conflicts: # resources/vanilla # src/network/mcpe/protocol/serializer/PacketSerializer.php
This commit is contained in:
commit
05bd92a94b
@ -222,9 +222,9 @@ class PacketSerializer extends BinaryStream{
|
|||||||
/** @var CompoundTag|null $compound */
|
/** @var CompoundTag|null $compound */
|
||||||
$compound = null;
|
$compound = null;
|
||||||
if($nbtLen === 0xffff){
|
if($nbtLen === 0xffff){
|
||||||
$c = $this->getByte();
|
$nbtDataVersion = $this->getByte();
|
||||||
if($c !== 1){
|
if($nbtDataVersion !== 1){
|
||||||
throw new PacketDecodeException("Unexpected NBT count $c");
|
throw new PacketDecodeException("Unexpected NBT data version $nbtDataVersion");
|
||||||
}
|
}
|
||||||
$compound = $this->getNbtCompoundRoot();
|
$compound = $this->getNbtCompoundRoot();
|
||||||
}elseif($nbtLen !== 0){
|
}elseif($nbtLen !== 0){
|
||||||
@ -263,7 +263,7 @@ class PacketSerializer extends BinaryStream{
|
|||||||
$nbt = $item->getNbt();
|
$nbt = $item->getNbt();
|
||||||
if($nbt !== null){
|
if($nbt !== null){
|
||||||
$this->putLShort(0xffff);
|
$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)));
|
$this->put((new NetworkNbtSerializer())->write(new TreeRoot($nbt)));
|
||||||
}else{
|
}else{
|
||||||
$this->putLShort(0);
|
$this->putLShort(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user