AsyncPool: Remove Server dependency (API breaks included)

This brings two plugin-breaking changes: AsyncTask->onCompletion() and AsyncTask->onProgressUpdate() no longer accept Server parameters.

This now allows for the functionality of AsyncPool and AsyncTask to be tested outside of a Server.
This commit is contained in:
Dylan K. Taylor
2018-09-10 15:47:12 +01:00
parent 5ce2d5e072
commit d62e00cc74
11 changed files with 19 additions and 40 deletions

View File

@ -24,9 +24,7 @@ declare(strict_types=1);
namespace pocketmine\updater;
use pocketmine\scheduler\AsyncTask;
use pocketmine\Server;
use pocketmine\utils\Internet;
class UpdateCheckTask extends AsyncTask{
@ -72,7 +70,7 @@ class UpdateCheckTask extends AsyncTask{
}
}
public function onCompletion(Server $server){
public function onCompletion(){
/** @var AutoUpdater $updater */
$updater = $this->fetchLocal();
if($this->hasResult()){