Throw invalid event exception when a plugin tries to declare an abstract event

This commit is contained in:
Shoghi Cervantes
2014-08-15 16:15:12 +02:00
parent 2f9494ed52
commit 31b92b392e
2 changed files with 2 additions and 2 deletions

View File

@ -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");
}