Java 类net.minecraftforge.fml.relauncher.FMLLaunchHandler 实例源码

项目:CCTweaks    文件:TweakRegistry.java   
private static void sortTweakers() {
    TaskProfiler profiler = new TaskProfiler();
    profiler.startOnce("Tweak Sorting.");
    LogHelper.info("Sorting tweakers..");
    for (TGameTweak tweak : allTweakers) {
        LogHelper.debug("Attempting registration of tweaker \"%s\"...", tweak.getTweakName());
        if (tweak instanceof TSideTweak) {
            if (!FMLLaunchHandler.side().equals(((TSideTweak) tweak).getSide())) {
                LogHelper.info("Tweaker \"%s\" will NOT be loaded as it is only for %s side!", tweak.getTweakName(), ((TSideTweak) tweak).getSide().toString());
                continue;
            }
        }
        if (tweak.isEnabled()) {
            activeTweakers.add(tweak);
            LogHelper.debug("Successfully registered Tweaker \"%s\"!", tweak.getTweakName());
        }
    }
    TaskProfiler.ProfilerResult result = profiler.endOnce();
    LogHelper.info("Tweaker sorting successfully found %s enabled tweakers in %sMs.", activeTweakers.size(), TimeUnit.NANOSECONDS.toMillis(result.time));
}
项目:CustomWorldGen    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The log4j2 queue is excluded so it is correctly visible from the obfuscated
    // and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.util.QueueLogAppender");

    classLoader.addClassLoaderExclusion("jline.");
    classLoader.addClassLoaderExclusion("org.fusesource.");
    classLoader.addClassLoaderExclusion("net.minecraftforge.server.console.TerminalConsoleAppender");

    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:CustomWorldGen    文件:MinecraftDummyContainer.java   
@Override
public Certificate getSigningCertificate()
{
    if (FMLLaunchHandler.side() != Side.CLIENT)
        return null;

    try
    {
        Class<?> cbr = Class.forName("net.minecraft.client.ClientBrandRetriever", false, getClass().getClassLoader());
        Certificate[] certificates = cbr.getProtectionDomain().getCodeSource().getCertificates();
        return certificates != null ? certificates[0] : null;
    }
    catch (Exception e){} // Errors don't matter just return null.
    return null;
}
项目:CustomWorldGen    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    liveEnv = (Boolean)data.get("runtimeDeobfuscationEnabled");
    cl = (LaunchClassLoader) data.get("classLoader");
    File mcDir = (File)data.get("mcLocation");
    fmlLocation = (File)data.get("coremodLocation");
    ClassPatchManager.INSTANCE.setup(FMLLaunchHandler.side());
    FMLDeobfuscatingRemapper.INSTANCE.setup(mcDir, cl, (String) data.get("deobfuscationFileName"));
}
项目:BIGB    文件:NEITransformer.java   
@Override
public byte[] transform(String name, String tname, byte[] bytes) {
    if (bytes == null) return null;
    try {
        if (FMLLaunchHandler.side().isClient())
            bytes = transformSubclasses(name, bytes);

        bytes = transformer.transform(name, bytes);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    return bytes;
}
项目:SasaLib    文件:SasaClassTransformer.java   
@Override
public byte[] transform(String name, String transformedName, byte[] bytes)
{
    if (FMLLaunchHandler.side().isClient() && transformedName.equals(TARGET_CLASS_NAME2))
    {
        return transFormMethod(bytes);
    }
    return bytes;
}
项目:CustomWorldGen    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:TeslaEssentials    文件:TileDataSync.java   
@Override
public IMessage handleClientMessage(TileDataSync message, MessageContext ctx) {
    if(FMLLaunchHandler.side().isClient()) message.sendToClassHandler();
    return null;
}
项目:Alchemy    文件:AlchemyEngine.java   
public static Side runtimeSide() { return FMLLaunchHandler.side(); }