use pocketmine\network\mcpe\handler\PacketHandler; class EducationSettingsPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::EDUCATION_SETTINGS_PACKET; /** @var string */ private $codeBuilderDefaultUri; /** @var bool */ private $hasQuiz; public static function create(string $codeBuilderDefaultUri, bool $hasQuiz) : self{ $result = new self; $result->codeBuilderDefaultUri = $codeBuilderDefaultUri; $result->hasQuiz = $hasQuiz; return $result; } public function getCodeBuilderDefaultUri() : string{ return $this->codeBuilderDefaultUri; } public function getHasQuiz() : bool{ return $this->hasQuiz; } protected function decodePayload() : void{ $this->codeBuilderDefaultUri = $this->getString(); $this->hasQuiz = $this->getBool(); } protected function encodePayload() : void{ $this->putString($this->codeBuilderDefaultUri); $this->putBool($this->hasQuiz); } public function handle(PacketHandler $handler) : bool{ return $handler->handleEducationSettings($this); } }