mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
ServerScheduler: remove nonsensical condition in addTask()
now that return type declarations exist, it's not possible for this to return a non-Plugin instance.
This commit is contained in:
@ -275,12 +275,8 @@ class ServerScheduler{
|
||||
* @throws PluginException
|
||||
*/
|
||||
private function addTask(Task $task, int $delay, int $period){
|
||||
if($task instanceof PluginTask){
|
||||
if(!($task->getOwner() instanceof Plugin)){
|
||||
throw new PluginException("Invalid owner of PluginTask " . get_class($task));
|
||||
}elseif(!$task->getOwner()->isEnabled()){
|
||||
throw new PluginException("Plugin '" . $task->getOwner()->getName() . "' attempted to register a task while disabled");
|
||||
}
|
||||
if($task instanceof PluginTask and !$task->getOwner()->isEnabled()){
|
||||
throw new PluginException("Plugin '" . $task->getOwner()->getName() . "' attempted to register a task while disabled");
|
||||
}
|
||||
|
||||
if($delay <= 0){
|
||||
|
Reference in New Issue
Block a user