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