private static FMLLaunchHandler instance(LaunchClassLoader launchLoader, FMLTweaker tweaker) { if (INSTANCE == null) { INSTANCE = new FMLLaunchHandler(launchLoader, tweaker); } return INSTANCE; }
private FMLLaunchHandler(LaunchClassLoader launchLoader, FMLTweaker tweaker) { this.classLoader = launchLoader; this.tweaker = tweaker; this.minecraftHome = tweaker.getGameDir(); this.classLoader.addClassLoaderExclusion("cpw.mods.fml.relauncher."); this.classLoader.addClassLoaderExclusion("net.minecraftforge.classloading."); this.classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.deobf."); this.classLoader.addTransformerExclusion("cpw.mods.fml.common.patcher."); }
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker) { CoreModManager.mcDir = mcDir; CoreModManager.tweaker = tweaker; try { // Are we in a 'decompiled' environment? byte[] bs = classLoader.getClassBytes("net.minecraft.world.World"); if (bs != null) { FMLRelaunchLog.info("Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation"); deobfuscatedEnvironment = true; } } catch (IOException e1) { } if (!deobfuscatedEnvironment) { FMLRelaunchLog.fine("Enabling runtime deobfuscation"); } tweaker.injectCascadingTweak("cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker"); try { classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.PatchingTransformer"); } catch (Exception e) { FMLRelaunchLog.log(Level.ERROR, e, "The patch transformer failed to load! This is critical, loading cannot continue!"); throw Throwables.propagate(e); } loadPlugins = new ArrayList<FMLPluginWrapper>(); for (String rootPluginName : rootPlugins) { loadCoreMod(classLoader, rootPluginName, new File(FMLTweaker.getJarLocation())); } if (loadPlugins.isEmpty()) { throw new RuntimeException("A fatal error has occured - no valid fml load plugin was found - this is a completely corrupt FML installation."); } FMLRelaunchLog.fine("All fundamental core mods are successfully located"); // Now that we have the root plugins loaded - lets see what else might // be around String commandLineCoremods = System.getProperty("fml.coreMods.load", ""); for (String coreModClassName : commandLineCoremods.split(",")) { if (coreModClassName.isEmpty()) { continue; } FMLRelaunchLog.info("Found a command line coremod : %s", coreModClassName); loadCoreMod(classLoader, coreModClassName, null); } discoverCoreMods(mcDir, classLoader); }
public static void configureForClientLaunch(LaunchClassLoader loader, FMLTweaker tweaker) { instance(loader, tweaker).setupClient(); }
public static void configureForServerLaunch(LaunchClassLoader loader, FMLTweaker tweaker) { instance(loader, tweaker).setupServer(); }
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker) { CoreModManager.mcDir = mcDir; CoreModManager.tweaker = tweaker; try { // Are we in a 'decompiled' environment? byte[] bs = classLoader.getClassBytes("net.minecraft.world.World"); if (bs != null) { FMLRelaunchLog.info("Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation"); deobfuscatedEnvironment = true; } } catch (IOException e1) { } if (!deobfuscatedEnvironment) { FMLRelaunchLog.fine("Enabling runtime deobfuscation"); } tweaker.injectCascadingTweak("cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker"); try { classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.PatchingTransformer"); } catch (Exception e) { FMLRelaunchLog.log(Level.ERROR, e, "The patch transformer failed to load! This is critical, loading cannot continue!"); throw Throwables.propagate(e); } loadPlugins = new ArrayList<FMLPluginWrapper>(); for (String rootPluginName : rootPlugins) { loadCoreMod(classLoader, rootPluginName, new File(FMLTweaker.getJarLocation())); } if (loadPlugins.isEmpty()) { throw new RuntimeException("A fatal error has occured - no valid fml load plugin was found - this is a completely corrupt FML installation."); } FMLRelaunchLog.fine("All fundamental core mods are successfully located"); // Now that we have the root plugins loaded - lets see what else might // be around String commandLineCoremods = System.getProperty("fml.coreMods.load", ""); for (String coreModClassName : commandLineCoremods.split(",")) { if (coreModClassName.isEmpty()) { continue; } FMLRelaunchLog.info("Found a command line coremod : %s", coreModClassName); loadCoreMod(classLoader, coreModClassName, null); } discoverCoreMods(mcDir, classLoader); // Cauldron start - group output of @MCVersion warnings if (!noVersionAnnotationCoreMods.isEmpty()) { FMLRelaunchLog.warning("The following coremods do not have a @MCVersion annotation. They may cause problems if this is not the correct version of Minecraft for them."); StringBuilder sb = new StringBuilder("Missing @MCVersion: "); for (String className : noVersionAnnotationCoreMods) { sb.append(className).append(" "); } FMLRelaunchLog.warning(sb.toString()); } // Cauldron end }
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker) { CoreModManager.mcDir = mcDir; CoreModManager.tweaker = tweaker; try { // Are we in a 'decompiled' environment? byte[] bs = classLoader.getClassBytes("net.minecraft.world.World"); if (bs != null) { FMLRelaunchLog.info("Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation"); deobfuscatedEnvironment = true; } } catch (IOException e1) { } if (!deobfuscatedEnvironment) { FMLRelaunchLog.fine("Enabling runtime deobfuscation"); } tweaker.injectCascadingTweak("cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker"); try { classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.PatchingTransformer"); } catch (Exception e) { FMLRelaunchLog.log(Level.SEVERE, e, "The patch transformer failed to load! This is critical, loading cannot continue!"); throw Throwables.propagate(e); } loadPlugins = new ArrayList<FMLPluginWrapper>(); for (String rootPluginName : rootPlugins) { loadCoreMod(classLoader, rootPluginName, new File(FMLTweaker.getJarLocation())); } if (loadPlugins.isEmpty()) { throw new RuntimeException("A fatal error has occured - no valid fml load plugin was found - this is a completely corrupt FML installation."); } FMLRelaunchLog.fine("All fundamental core mods are successfully located"); // Now that we have the root plugins loaded - lets see what else might // be around String commandLineCoremods = System.getProperty("fml.coreMods.load", ""); for (String coreModClassName : commandLineCoremods.split(",")) { if (coreModClassName.isEmpty()) { continue; } FMLRelaunchLog.info("Found a command line coremod : %s", coreModClassName); loadCoreMod(classLoader, coreModClassName, null); } discoverCoreMods(mcDir, classLoader); }