Protocol changes for 1.9.0

This commit is contained in:
Dylan K. Taylor
2019-02-07 21:56:42 +00:00
parent 37c2d78731
commit b8703d5dff
19 changed files with 390 additions and 96 deletions

View File

@ -28,19 +28,37 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\mcpe\NetworkSession;
class AddPaintingPacket extends AddHangingEntityPacket{
class AddPaintingPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ADD_PAINTING_PACKET;
/** @var string */
public $title;
/** @var int */
public $entityRuntimeId;
/** @var int */
public $x;
/** @var int|null */
public $entityUniqueId = null;
/** @var int */
public $y;
/** @var int */
public $z;
/** @var int */
public $direction;
protected function decodePayload(){
parent::decodePayload();
$this->entityUniqueId = $this->getEntityUniqueId();
$this->entityRuntimeId = $this->getEntityRuntimeId();
$this->getBlockPosition($this->x, $this->y, $this->z);
$this->direction = $this->getVarInt();
$this->title = $this->getString();
}
protected function encodePayload(){
parent::encodePayload();
$this->putEntityUniqueId($this->entityUniqueId ?? $this->entityRuntimeId);
$this->putEntityRuntimeId($this->entityRuntimeId);
$this->putBlockPosition($this->x, $this->y, $this->z);
$this->putVarInt($this->direction);
$this->putString($this->title);
}