mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Code cleanup
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
namespace pocketmine\scheduler;
|
||||
|
||||
use pocketmine\Server;
|
||||
|
||||
/**
|
||||
|
@ -168,9 +168,9 @@ class ServerScheduler{
|
||||
private function addTask(Task $task, $delay, $period){
|
||||
if($task instanceof PluginTask){
|
||||
if(!($task->getOwner() instanceof Plugin)){
|
||||
throw new \Exception("Invalid owner of PluginTask ".get_class($task));
|
||||
throw new \Exception("Invalid owner of PluginTask " . get_class($task));
|
||||
}elseif(!$task->getOwner()->isEnabled()){
|
||||
throw new \Exception("Plugin '".$task->getOwner()->getName()."' attempted to register a task while disabled");
|
||||
throw new \Exception("Plugin '" . $task->getOwner()->getName() . "' attempted to register a task while disabled");
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,8 +243,10 @@ class ServerScheduler{
|
||||
$task->onCompletion(Server::getInstance());
|
||||
$task->setCompleted();
|
||||
unset($this->asyncTaskStorage[$task->getTaskId()]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -154,6 +154,7 @@ class TaskHandler{
|
||||
if($this->timingName !== null){
|
||||
return $this->timingName;
|
||||
}
|
||||
|
||||
return get_class($this->task);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user