@@ -0,0 +1,1977 @@
+package emergencylanding.k.exst.modules;%0A%0Aimport java.util.*;%0A%0Aimport emergencylanding.k.exst.mods.IMod;%0Aimport emergencylanding.k.exst.mods.Mods;%0A%0Apublic final class ModuleSystem %7B%0A    private static final Class%3CIModule%3E IMODULE_CLASS = IModule.class;%0A%0A    private static ArrayList%3CIModule%3E modules = new ArrayList%3CIModule%3E();%0A%0A    private ModuleSystem() %7B%0A        throw new AssertionError(%22Please don't create the module system.%22);%0A    %7D%0A%0A    public static void loadModulesFromMods() %7B%0A        List%3CIMod%3E loaded = Mods.getLoadedMods();%0A        for (IMod m : loaded) %7B%0A            if (m instanceof IModule) %7B%0A                IModule im = (IModule) m;%0A                modules.add(im);%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Gets the registered modules for the given binary class name.%0A     * %0A     * @param fullBinaryName%0A     *            - the full binary name for the parent class%0A     * @return an array of %7B@link IModule%7D instances whose getClass() method%0A     *         either returns the same class represented by the full binary name%0A     *         or a class that extends that class.%0A     */%0A    public static IModule%5B%5D getRegisteredModules(String fullBinaryName) %7B%0A        Class%3C?%3E fbnClass = null;%0A        try %7B%0A            fbnClass = Class.forName(fullBinaryName);%0A        %7D catch (ClassNotFoundException e1) %7B%0A            System.err.println(%22Module class %22 + fullBinaryName%0A                    + %22 does not exist, returning empty.%22);%0A        %7D%0A        if (!IMODULE_CLASS.isAssignableFrom(fbnClass)) %7B%0A            throw new ClassCastException(fullBinaryName + %22 does not extend %22%0A                    + IMODULE_CLASS);%0A        %7D%0A        if (fbnClass == null) %7B%0A            return new IModule%5B0%5D;%0A        %7D%0A        ArrayList%3CIModule%3E matched = new ArrayList%3CIModule%3E();%0A        for (IModule m : modules) %7B%0A            if (fbnClass.isInstance(m)) %7B%0A                matched.add(m);%0A            %7D%0A        %7D%0A        return matched.toArray(new IModule%5B0%5D);%0A    %7D%0A%7D%0A

Add module handler