mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +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,13 +275,9 @@ class ServerScheduler{
|
|||||||
* @throws PluginException
|
* @throws PluginException
|
||||||
*/
|
*/
|
||||||
private function addTask(Task $task, int $delay, int $period){
|
private function addTask(Task $task, int $delay, int $period){
|
||||||
if($task instanceof PluginTask){
|
if($task instanceof PluginTask and !$task->getOwner()->isEnabled()){
|
||||||
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");
|
throw new PluginException("Plugin '" . $task->getOwner()->getName() . "' attempted to register a task while disabled");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if($delay <= 0){
|
if($delay <= 0){
|
||||||
$delay = -1;
|
$delay = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user