Java 类cpw.mods.fml.relauncher.FMLLaunchHandler 实例源码

项目:4Space-5    文件:DepLoader.java   
private void loadDeps()
{
    downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader();
    try
    {
        while (!depSet.isEmpty())
        {
            Iterator<String> it = depSet.iterator();
            Dependency dep = depMap.get(it.next());
            it.remove();
            load(dep);
        }
    }
    finally
    {
        if (popupWindow != null)
        {
            popupWindow.setVisible(false);
            popupWindow.dispose();
        }
    }
}
项目:4Space-5    文件:DepLoader.java   
private void loadDeps() {
    downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader();
    try {
        while (!depSet.isEmpty()) {
            Iterator<String> it = depSet.iterator();
            Dependency dep = depMap.get(it.next());
            it.remove();
            load(dep);
        }
    } finally {
        if (popupWindow != null) {
            popupWindow.setVisible(false);
            popupWindow.dispose();
        }
    }
}
项目:InventoryTools    文件:DepLoader.java   
private void loadDeps()
{
    downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader();
    try
    {
        while (!depSet.isEmpty())
        {
            Iterator<String> it = depSet.iterator();
            Dependency dep = depMap.get(it.next());
            it.remove();
            load(dep);
        }
    } finally
    {
        if (popupWindow != null)
        {
            popupWindow.setVisible(false);
            popupWindow.dispose();
        }
    }
}
项目:vsminecraft    文件:DepLoader.java   
private void loadDeps() {
    downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader();
    try {
        while (!depSet.isEmpty()) {
            Iterator<String> it = depSet.iterator();
            Dependency dep = depMap.get(it.next());
            it.remove();
            load(dep);
        }
    } finally {
        if (popupWindow != null) {
            popupWindow.setVisible(false);
            popupWindow.dispose();
        }
    }
}
项目:4Space-5    文件: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;
}
项目:TRHS_Club_Mod_2016    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addClassLoaderExclusion("org.apache.");
    classLoader.addClassLoaderExclusion("com.google.common.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:TRHS_Club_Mod_2016    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The mojang packages are excluded so the log4j2 queue is correctly visible from
    // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:TRHS_Club_Mod_2016    文件: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;
}
项目:TRHS_Club_Mod_2016    文件: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"));
}
项目:CauldronGit    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addClassLoaderExclusion("org.apache.");
    classLoader.addClassLoaderExclusion("com.google.common.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:CauldronGit    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The mojang packages are excluded so the log4j2 queue is correctly visible from
    // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:CauldronGit    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:Cauldron    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addClassLoaderExclusion("org.apache.");
    classLoader.addClassLoaderExclusion("com.google.common.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The mojang packages are excluded so the log4j2 queue is correctly visible from
    // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:Cauldron    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addClassLoaderExclusion("org.apache.");
    classLoader.addClassLoaderExclusion("com.google.common.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The mojang packages are excluded so the log4j2 queue is correctly visible from
    // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:Cauldron    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addClassLoaderExclusion("org.apache.");
    classLoader.addClassLoaderExclusion("com.google.common.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // The mojang packages are excluded so the log4j2 queue is correctly visible from
    // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything
    classLoader.addClassLoaderExclusion("com.mojang.");
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:Cauldron    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:RotatableBlocks    文件:RBCoreASMTransformer.java   
private void handleMethod(ClassNode classNode, String from, MethodNode mn)
{
    if ( FMLLaunchHandler.side() == Side.SERVER && hasAnnotation( mn.visibleAnnotations, RBClientMethod.class ) )
    {
        RBLog.info( "Skipping, method client only." );
        return;
    }

    Iterator<AbstractInsnNode> i = mn.instructions.iterator();
    while (i.hasNext())
    {
        processNode( i.next(), from, classNode.name );
    }

    for (MethodNode tmn : classNode.methods)
    {
        if ( tmn.name.equals( mn.name ) && tmn.desc.equals( mn.desc ) )
        {
            RBLog.info( "Found " + tmn.name + " : Appending" );

            AbstractInsnNode finalReturn = mn.instructions.getLast();
            while (!isReturn( finalReturn.getOpcode() ))
            {
                mn.instructions.remove( finalReturn );
                finalReturn = mn.instructions.getLast();
            }
            mn.instructions.remove( finalReturn );

            tmn.instructions.insert( mn.instructions );
            return;
        }
    }

    RBLog.info( "No Such Method " + mn.name + " : Adding" );
    classNode.methods.add( mn );
}
项目:RuneCraftery    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:RuneCraftery    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:RuneCraftery    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:RuneCraftery    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:RuneCraftery    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:RuneCraftery    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:SevenCommons    文件:TileEntityTickHook.java   
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
    super.visitMethodInsn(opcode, owner, name, desc);
    String teIntName = "net/minecraft/tileentity/TileEntity";
    Type worldType = Type.getObjectType("net/minecraft/world/World");

    if (owner.equals(teIntName) && name.equals(MCPNames.method(MCPNames.M_UPDATE_ENTITY))) {
        boolean client = FMLLaunchHandler.side().isClient();

        Label after = new Label();
        if (client) {
            super.visitVarInsn(ALOAD, 0);
            super.visitFieldInsn(GETFIELD, worldType.getInternalName(), MCPNames.field(MCPNames.F_IS_REMOTE), Type.BOOLEAN_TYPE.getDescriptor());
            super.visitJumpInsn(IFNE, after);
        }

        super.visitVarInsn(ALOAD, lastLoadLocal);
        super.visitVarInsn(ALOAD, lastLoadLocal);
        super.visitFieldInsn(GETFIELD, teIntName, CompanionFieldAdder.COMPANION_FIELD, Type.getDescriptor(SyncCompanion.class));

        String hookClazz = Type.getInternalName(ASMHooks.class);
        String invokeCheck = ASMHooks.INVOKE_SYNC_COMP_CHECK;
        String invokeCheckDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(Object.class), Type.getType(SyncCompanion.class));
        super.visitMethodInsn(INVOKESTATIC, hookClazz, invokeCheck, invokeCheckDesc);

        if (client) {
            super.visitLabel(after);
        }
    }
}
项目:BetterNutritionMod    文件:FMLTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForClientLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:BetterNutritionMod    文件:FMLServerTweaker.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
    classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
    classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");
    classLoader.addClassLoaderExclusion("LZMA.");
    FMLLaunchHandler.configureForServerLaunch(classLoader, this);
    FMLLaunchHandler.appendCoreMods();
}
项目:BetterNutritionMod    文件:FMLSanityChecker.java   
@Override
public void injectData(Map<String, Object> data)
{
    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"));
}
项目:VivecraftForgeExtensions    文件:ASMHandlerCreeperRadius.java   
@Override
public boolean shouldPatchClass() {
    return FMLLaunchHandler.side() != Side.CLIENT;
}
项目:Jiffy    文件:TransformLoader.java   
@Override
public String getModContainerClass() {
    if (FMLLaunchHandler.side() == Side.CLIENT)
        return JiffyDummyContainer.class.getName();
    return null;
}
项目:SevenCommons    文件:EntityTickHook.java   
@Override
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
    super.visitFieldInsn(opcode, owner, name, desc);

    String entityIntName = "net/minecraft/entity/Entity";
    if (foundIAdd && owner.equals(entityIntName) && name.equals(MCPNames.field(MCPNames.F_ENTITY_TICKS_EXISTED))) {
        Type syncerCompanionType = Type.getType(SyncCompanion.class);
        Type worldType = Type.getObjectType("net/minecraft/world/World");

        boolean client = FMLLaunchHandler.side().isClient();

        Label after = new Label();
        if (client) {
            super.visitVarInsn(ALOAD, 0);
            super.visitFieldInsn(GETFIELD, worldType.getInternalName(), MCPNames.field(MCPNames.F_IS_REMOTE), Type.BOOLEAN_TYPE.getDescriptor());
            super.visitJumpInsn(IFNE, after);
        }

        super.visitVarInsn(ALOAD, 1); // entity parameter
        super.visitVarInsn(ALOAD, 1);
        super.visitFieldInsn(GETFIELD, entityIntName, CompanionFieldAdder.COMPANION_FIELD, syncerCompanionType.getDescriptor());

        String hookClazz = Type.getInternalName(ASMHooks.class);
        String invokeCheck = ASMHooks.INVOKE_SYNC_COMP_CHECK;
        String invokeCheckDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(Object.class), Type.getType(SyncCompanion.class));
        super.visitMethodInsn(INVOKESTATIC, hookClazz, invokeCheck, invokeCheckDesc);

        super.visitVarInsn(ALOAD, 1);
        super.visitFieldInsn(GETFIELD, entityIntName, EntitySyncPropsHooks.FIELD_NAME, Type.getDescriptor(List.class));

        String tickSyncProps = ASMHooks.TICK_IEEP_COMPANIONS;
        String tickSyncPropsDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(List.class));
        super.visitMethodInsn(INVOKESTATIC, hookClazz, tickSyncProps, tickSyncPropsDesc);

        if (client) {
            super.visitLabel(after);
        }

        done = true;
    }

    foundIAdd = false;
}