Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- for (ClassPath.ClassInfo classInfo : ClassPath.from(getClassLoader()).getTopLevelClasses("de.msgamerhd.bedwars.listeners")) {
- @SuppressWarnings("rawtypes")
- Class clazz = Class.forName(classInfo.getName());
- if (Listener.class.isAssignableFrom(clazz)) {
- Bukkit.getPluginManager().registerEvents((Listener) clazz.newInstance(), this);
- }
- }
- } catch (IOException | ClassNotFoundException | IllegalAccessException | InstantiationException e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement