Created
February 5, 2014 14:32
-
-
Save Muwbi/8824810 to your computer and use it in GitHub Desktop.
register listeners recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void registerListeners() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { | |
PluginManager pluginManager = this.getServer().getPluginManager(); | |
for(ClassPath.ClassInfo classInfo: ClassPath.from(this.getClassLoader()).getTopLevelClasses("de.muwbi.clashofnations.listeners")) { | |
pluginManager.registerEvents((Listener) Class.forName(classInfo.getName()).newInstance(), this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment