use pocketmine\network\mcpe\NetworkSession; class LecternUpdatePacket extends DataPacket/* implements ServerboundPacket*/{ public const NETWORK_ID = ProtocolInfo::LECTERN_UPDATE_PACKET; /** @var int */ public $page; /** @var int */ public $totalPages; /** @var int */ public $x; /** @var int */ public $y; /** @var int */ public $z; /** @var bool */ public $dropBook; protected function decodePayload() : void{ $this->page = $this->getByte(); $this->totalPages = $this->getByte(); $this->getBlockPosition($this->x, $this->y, $this->z); $this->dropBook = $this->getBool(); } protected function encodePayload() : void{ $this->putByte($this->page); $this->putByte($this->totalPages); $this->putBlockPosition($this->x, $this->y, $this->z); $this->putBool($this->dropBook); } public function handle(NetworkSession $session) : bool{ return $session->handleLecternUpdate($this); } }