Advertisement
MsGamerHD

Untitled

Aug 24th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.         try {
  2.             for (ClassPath.ClassInfo classInfo : ClassPath.from(getClassLoader()).getTopLevelClasses("de.msgamerhd.bedwars.listeners")) {
  3.                 @SuppressWarnings("rawtypes")
  4.                 Class clazz = Class.forName(classInfo.getName());
  5.                 if (Listener.class.isAssignableFrom(clazz)) {
  6.                     Bukkit.getPluginManager().registerEvents((Listener) clazz.newInstance(), this);
  7.                 }
  8.             }
  9.         } catch (IOException | ClassNotFoundException | IllegalAccessException | InstantiationException e) {
  10.             e.printStackTrace();
  11.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement