Skip to content

Instantly share code, notes, and snippets.

@mkotb
Created July 20, 2014 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkotb/70d7547599f72e84d5b3 to your computer and use it in GitHub Desktop.
Save mkotb/70d7547599f72e84d5b3 to your computer and use it in GitHub Desktop.
Fuck. reflections.
for(Class<?> cls : new Reflections("io.mazenmc.notifier.listeners.bukkit").getSubTypesOf(Object.class)) {
getServer().getPluginManager().registerEvents((Listener) cls.newInstance(), plugin);
log(cls.getSimpleName());
}
for(Class<?> cls : new Reflections("io.mazenmc.notifier.listeners.notifier").getSubTypesOf(Object.class)) {
getEventHandler().registerListener((NotifierListener) cls.newInstance());
log(cls.getSimpleName());
}
@cameronb23
Copy link

I KNOW RIGHT!#@!!$%*(1 98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment