mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Throw invalid event exception when a plugin tries to declare an abstract event
This commit is contained in:
@ -704,7 +704,7 @@ class PluginManager{
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function registerEvent($event, Listener $listener, $priority, EventExecutor $executor, Plugin $plugin, $ignoreCancelled = false){
|
||||
if(!is_subclass_of($event, "pocketmine\\event\\Event")){
|
||||
if(!is_subclass_of($event, "pocketmine\\event\\Event") or (new \ReflectionClass($event))->isAbstract()){
|
||||
throw new \Exception($event . " is not a valid Event");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user