Implemented new Inventory windows on Player, Chest and Furnace

This commit is contained in:
Shoghi Cervantes
2014-05-23 20:53:06 +02:00
parent 27e82ea60a
commit 53749483c3
71 changed files with 1189 additions and 1009 deletions

View File

@ -52,8 +52,9 @@ abstract class AsyncTask extends \Threaded{
* @return mixed
*/
public function getResult(){
return $this->synchronized(function(){
return $this->synchronized(function (){
$this->finished = true;
return @unserialize($this->result);
});
}

View File

@ -26,6 +26,7 @@ class AsyncWorker extends \Worker{
public function start($options = PTHREADS_INHERIT_CLASSES){
$this->path = \pocketmine\PATH;
return parent::start($options & ~PTHREADS_INHERIT_CLASSES);
}

View File

@ -205,11 +205,13 @@ class ServerScheduler{
}
if($this->asyncTasks > 0){ //Garbage collector
$this->asyncPool->collect(function(AsyncTask $task){
$this->asyncPool->collect(function (AsyncTask $task){
if($task->isCompleted() or ($task->isFinished() and !$task->hasResult())){
--$this->asyncTasks;
return true;
}
return false;
});
}