use pocketmine\network\mcpe\handler\PacketHandler; 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->buf->getByte(); $this->totalPages = $this->buf->getByte(); $this->buf->getBlockPosition($this->x, $this->y, $this->z); $this->dropBook = $this->buf->getBool(); } protected function encodePayload() : void{ $this->buf->putByte($this->page); $this->buf->putByte($this->totalPages); $this->buf->putBlockPosition($this->x, $this->y, $this->z); $this->buf->putBool($this->dropBook); } public function handle(PacketHandler $handler) : bool{ return $handler->handleLecternUpdate($this); } }