mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Improved checks for event registration
This commit is contained in:
parent
4a9acf564c
commit
dbb8e8ad0a
@ -754,8 +754,15 @@ class PluginManager{
|
||||
if($class->isAbstract()){
|
||||
throw new PluginException($event . " is an abstract Event");
|
||||
}
|
||||
if($class->getProperty("handlerList")->getDeclaringClass()->getName() !== $event){
|
||||
throw new PluginException($event . " does not have a handler list");
|
||||
|
||||
if(!$class->hasProperty("handlerList") or ($property = $class->getProperty("handlerList"))->getDeclaringClass()->getName() !== $event){
|
||||
throw new PluginException($event . " does not have a valid handler list");
|
||||
}
|
||||
if(!$property->isStatic()){
|
||||
throw new PluginException($event . " handlerList property is not static");
|
||||
}
|
||||
if(!$property->isPublic()){
|
||||
throw new PluginException($event . " handlerList property is not public");
|
||||
}
|
||||
|
||||
if(!$plugin->isEnabled()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user