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

@ -26,7 +26,6 @@ namespace pocketmine\level\light;
use pocketmine\level\format\Chunk;
use pocketmine\level\Level;
use pocketmine\scheduler\AsyncTask;
use pocketmine\Server;
class LightPopulationTask extends AsyncTask{
@ -48,7 +47,7 @@ class LightPopulationTask extends AsyncTask{
$this->chunk = $chunk->fastSerialize();
}
public function onCompletion(Server $server){
public function onCompletion() : void{
/** @var Level $level */
$level = $this->fetchLocal();
if(!$level->isClosed()){