mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +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:
parent
0a50b8cb9b
commit
299e4c8a85
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user