diff --git a/src/event/Listener.php b/src/event/Listener.php index 00d12c3f5..e39d0dcd9 100644 --- a/src/event/Listener.php +++ b/src/event/Listener.php @@ -43,9 +43,6 @@ use pocketmine\plugin\PluginManager; * Functions which meet the criteria can have the following annotations in their doc comments: * * - `@notHandler`: Marks a function as NOT being an event handler. Only needed if the function meets the above criteria. - * - `@softDepend [PluginName]`: Handler WILL NOT be registered if its event doesn't exist. Useful for soft-depending - * on plugin events. Plugin name is optional. - * Example: `@softDepend SimpleAuth` * - `@handleCancelled`: Cancelled events will STILL invoke this handler. * - `@priority `: Sets the priority at which this event handler will receive events. * Example: `@priority HIGHEST` diff --git a/src/plugin/PluginManager.php b/src/plugin/PluginManager.php index 15002bbdd..d1a0325f7 100644 --- a/src/plugin/PluginManager.php +++ b/src/plugin/PluginManager.php @@ -433,22 +433,13 @@ class PluginManager{ continue; } - $handlerClosure = $method->getClosure($listener); - - try{ - $eventClass = $parameters[0]->getClass(); - }catch(\ReflectionException $e){ //class doesn't exist - if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){ - $this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "() because plugin \"" . $tags["softDepend"] . "\" not found"); - continue; - } - - throw $e; - } + $eventClass = $parameters[0]->getClass(); if($eventClass === null or !$eventClass->isSubclassOf(Event::class)){ continue; } + $handlerClosure = $method->getClosure($listener); + try{ $priority = isset($tags["priority"]) ? EventPriority::fromString($tags["priority"]) : EventPriority::NORMAL; }catch(\InvalidArgumentException $e){