I have an error in my code that I can not solve: HTML: TypeError: "Argument 1 passed to pocketmine\scheduler\AsyncPool::submitTask() must be an instance of pocketmine\scheduler\AsyncTask, instance of Taylcd\ReportGUI\SaveTask given, called in C:\Users\Administrator\Desktop\server mcpe\plugins\ReportGUI\src\Taylcd\ReportGUI\ReportGUI.php on line 48" (EXCEPTION) in "src/pocketmine/scheduler/AsyncPool" at line 227 Code: PHP: public function onEnable() { $this->FormAPI = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); if(!$this->FormAPI or $this->FormAPI->isDisabled()) { $this->getLogger()->warning('Dependency FormAPI not found, disabling...'); $this->getPluginLoader()->disablePlugin($this); } $this->getServer()->getPluginManager()->registerEvents($this, $this); Server::getInstance()->getAsyncPool()->submitTask(new SaveTask($this)); $this->getConfig()->get('save-period', 600) * 20; $this->getServer()->getLogger()->info(TextFormat::AQUA . 'ReportGUI enabled. ' . TextFormat::GRAY . 'Made by Taylcd with ' . TextFormat::RED . "\xe2\x9d\xa4"); } I am new and do not know English, hope everyone helps me!
sure PHP: <?phpnamespace Taylcd\ReportGUI;use pocketmine\scheduler\Task;class SaveTask extends Task{ public function onRun(int $currentTick) { $this->getOwner()->save(); }
error .-. : HTML: 2019-06-02 [00:00:21] [Asynchronous Worker #1 thread/CRITICAL]: Error: "Call to undefined method Taylcd\ReportGUI\SaveTask::getOwner()" (EXCEPTION) in "plugins/ReportGUI/src/Taylcd/ReportGUI/SaveTask" at line 11 2019-06-02 [00:00:21] [Asynchronous Worker #1 thread/DEBUG]: #0 src/pocketmine/scheduler/AsyncTask(75): Taylcd\ReportGUI\SaveTask->onRun() 2019-06-02 [00:00:21] [Asynchronous Worker #1 thread/DEBUG]: #1 (): pocketmine\scheduler\AsyncTask->run()