Java 类cpw.mods.fml.common.ModClassLoader 实例源码

项目:4Space-5    文件:ClassDiscoverer.java   
public ClassDiscoverer(IStringMatcher matcher, Class<?>... superclasses) {
    this.matcher = matcher;
    this.superclasses = new String[superclasses.length];
    for (int i = 0; i < superclasses.length; i++)
        this.superclasses[i] = superclasses[i].getName().replace('.', '/');

    classes = new ArrayList<Class<?>>();
    modClassLoader = (ModClassLoader) Loader.instance().getModClassLoader();
}
项目:TRHS_Club_Mod_2016    文件:FMLConstructionEvent.java   
@SuppressWarnings("unchecked")
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
    this.reverseDependencies = (ListMultimap<String, String>) eventData[2];
}
项目:MercuriusUpdater    文件:MercuriusUpdaterMod.java   
private ClassLoader addClassPath(ClassLoader loader, File file) throws IOException
{
    if (loader instanceof LaunchClassLoader)
    {
        ((LaunchClassLoader)loader).addURL(file.toURI().toURL());
        return loader;
    }
    else if (loader instanceof ModClassLoader)
    {
        ((ModClassLoader)loader).addFile(file);
        return loader;
    }
    ClassLoader parent = loader.getParent();
    return parent == null ? null : addClassPath(parent, file);
}
项目:ThermosRebased    文件:FanEventHandler.java   
@Subscribe
public void constructMod(final FMLConstructionEvent event) {
    try {
        final ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(this.mContainer.getSource());
        modClassLoader.clearNegativeCacheFor(this.mCandidate.getClassList());
        NetworkRegistry.INSTANCE.register(this.mContainer, (Class)this.mContainer.getClass(), (String)null, event.getASMHarvestedData());
        Injector.inject(this.mMod, Injector.Phase.Construct, FMLCommonHandler.instance().getSide());
    }
    catch (Throwable e) {
        throw new IllegalStateException("Cannot construct fan", e);
    }
}
项目:CauldronGit    文件:FMLConstructionEvent.java   
@SuppressWarnings("unchecked")
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
    this.reverseDependencies = (ListMultimap<String, String>) eventData[2];
}
项目:Cauldron    文件:FMLConstructionEvent.java   
@SuppressWarnings("unchecked")
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
    this.reverseDependencies = (ListMultimap<String, String>) eventData[2];
}
项目:Cauldron    文件:FMLConstructionEvent.java   
@SuppressWarnings("unchecked")
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
    this.reverseDependencies = (ListMultimap<String, String>) eventData[2];
}
项目:Cauldron    文件:FMLConstructionEvent.java   
@SuppressWarnings("unchecked")
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
    this.reverseDependencies = (ListMultimap<String, String>) eventData[2];
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:BetterNutritionMod    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:secri    文件:DBHelper.java   
public static boolean has(boolean checkForUpdates) {
    try {
        checkForDatabaseUpdates = checkForUpdates;
        File databaseDir = new File(DownloadHelper.getDir(), "database");
        if (!databaseDir.exists()) {
            databaseDir.mkdir();
            DownloadHelper.downloadFile("database/Pixelmon.db", databaseURL);
            DownloadHelper.downloadFile("database/sqlite-jdbc-3.7.2.jar", sqliteURL);
        } else {
            File databaseFile = new File(databaseDir, "Pixelmon.db");
            if (!databaseFile.exists()) {
                DownloadHelper.downloadFile("database/Pixelmon.db", databaseURL);
            } else {
                if (checkForDatabaseUpdates)
                    checkVersion();
            }
            File sqlitejar = new File(databaseDir, "sqlite-jdbc-3.7.2.jar");
            if (!sqlitejar.exists())
                DownloadHelper.downloadFile("database/sqlite-jdbc-3.7.2.jar", sqliteURL);
            if (!sqlitejar.exists())
                System.out.println("SQLite Jar still not found at " + sqlitejar.getAbsolutePath());
            if (!databaseFile.exists())
                System.out.println("Database still not found at " + databaseFile.getAbsolutePath());
            ((ModClassLoader) Loader.instance().getModClassLoader()).addFile(sqlitejar);
        }

        Class.forName("org.sqlite.JDBC");
        Connection c = DriverManager.getConnection("jdbc:sqlite:" + DownloadHelper.getDir() + "/database/Pixelmon.db");
        if (c == null) {
            return false;
        }
        return true;
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
}
项目:TRHS_Club_Mod_2016    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:TRHS_Club_Mod_2016    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:CauldronGit    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:CauldronGit    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:Cauldron    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:Cauldron    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:Cauldron    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:Cauldron    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:Cauldron    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:Cauldron    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:RuneCraftery    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:RuneCraftery    文件:FMLConstructionEvent.java   
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
}
项目:RuneCraftery    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:RuneCraftery    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:RuneCraftery    文件:FMLConstructionEvent.java   
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
}
项目:RuneCraftery    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:BetterNutritionMod    文件:ModDiscoverer.java   
public void findClasspathMods(ModClassLoader modClassLoader)
{
    List<String> knownLibraries = ImmutableList.<String>builder()
            // skip default libs
            .addAll(modClassLoader.getDefaultLibraries())
            // skip loaded coremods
            .addAll(CoreModManager.getLoadedCoremods())
            // skip reparse coremods here
            .addAll(CoreModManager.getReparseableCoremods())
            .build();
    File[] minecraftSources = modClassLoader.getParentSources();
    if (minecraftSources.length == 1 && minecraftSources[0].isFile())
    {
        FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath());
        candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true));
    }
    else
    {
        for (int i = 0; i < minecraftSources.length; i++)
        {
            if (minecraftSources[i].isFile())
            {
                if (knownLibraries.contains(minecraftSources[i].getName()))
                {
                    FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath());
                }
                else
                {
                    FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                    candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true));
                }
            }
            else if (minecraftSources[i].isDirectory())
            {
                FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath());
                candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true));
            }
        }
    }

}
项目:BetterNutritionMod    文件:FMLConstructionEvent.java   
public FMLConstructionEvent(Object... eventData)
{
    this.modClassLoader = (ModClassLoader)eventData[0];
    this.asmData = (ASMDataTable) eventData[1];
}
项目:BetterNutritionMod    文件:FMLConstructionEvent.java   
public ModClassLoader getModClassLoader()
{
    return modClassLoader;
}
项目:CollectiveFramework    文件:MinecraftDependencyManager.java   
/**
 * Attempts to load the specified library (must be a proper java archive!)
 * @param file The file representing the library
 * @throws MalformedURLException
 */
public static void loadLibrary(File file) throws MalformedURLException {
    ((ModClassLoader) Loader.instance().getModClassLoader()).addFile(file);
}