Hello, I have a question. I want to make a AsyncTask, but I don't know how to make it and how to call it in the Main Class. Can someone show me how?
PHP: class AsyncTaskExample extends \pocketmine\scheduler\AsyncTask { public function __construct() { $this->storeLocal(mixed complex data to store); } public function onRun() : void { $this->publishProgress(progress); $this->setResult(result); } public function onCompletion(\pocketmine\Server $server) : void { $this->getResult(); $this->fetchLocal(); } public function onProgressUpdate(\pocketmine\Server $server, $progress) : void { $this->fetchLocal(); }} PHP: $this->getServer()->getAsyncPool()->submitTask(async task instance);