use pocketmine\network\mcpe\handler\SessionHandler; class AddPaintingPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::ADD_PAINTING_PACKET; /** @var string */ public $title; /** @var int|null */ public $entityUniqueId = null; /** @var int */ public $entityRuntimeId; /** @var int */ public $x; /** @var int */ public $y; /** @var int */ public $z; /** @var int */ public $direction; protected function decodePayload() : void{ $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() : void{ $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); } public function handle(SessionHandler $handler) : bool{ return $handler->handleAddPainting($this); } }