From c604a5e0480c7aa536d627b986bec159e2c6f932 Mon Sep 17 00:00:00 2001 From: cpw Date: Sun, 31 Aug 2014 13:35:38 -0400 Subject: [PATCH] Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch. --- .../main/java/cpw/mods/fml/common/launcher/FMLTweaker.java | 5 +++++ .../main/java/cpw/mods/fml/relauncher/ModListHelper.java | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fml/src/main/java/cpw/mods/fml/common/launcher/FMLTweaker.java b/fml/src/main/java/cpw/mods/fml/common/launcher/FMLTweaker.java index dc1e57211d..bd1e2e2f3d 100644 --- a/fml/src/main/java/cpw/mods/fml/common/launcher/FMLTweaker.java +++ b/fml/src/main/java/cpw/mods/fml/common/launcher/FMLTweaker.java @@ -130,6 +130,11 @@ public class FMLTweaker implements ITweaker { @Override public String getLaunchTarget() { + // Remove the extraneous mods and modListFile args + @SuppressWarnings("unchecked") + Map args = (Map) Launch.blackboard.get("launchArgs"); + args.remove("--modListFile"); + args.remove("--mods"); return "net.minecraft.client.main.Main"; } diff --git a/fml/src/main/java/cpw/mods/fml/relauncher/ModListHelper.java b/fml/src/main/java/cpw/mods/fml/relauncher/ModListHelper.java index 4f92468632..953b6faa4c 100644 --- a/fml/src/main/java/cpw/mods/fml/relauncher/ModListHelper.java +++ b/fml/src/main/java/cpw/mods/fml/relauncher/ModListHelper.java @@ -31,7 +31,6 @@ public class ModListHelper { if (listFile != null) { parseListFile(listFile); - args.remove("--modListFile"); } String extraMods = args.get("--mods"); if (extraMods != null) @@ -41,7 +40,6 @@ public class ModListHelper { { tryAddFile(modFile, null, modFile); } - args.remove("--mods"); } } private static void parseListFile(String listFile) { @@ -72,7 +70,7 @@ public class ModListHelper { FMLRelaunchLog.info("Failed to find the specified repository root %s", modList.repositoryRoot); return; } - + for (String s : modList.modRef) { StringBuilder sb = new StringBuilder(); @@ -91,7 +89,7 @@ public class ModListHelper { } } private static void tryAddFile(String modFileName, File repoRoot, String descriptor) { - File modFile = repoRoot != null ? new File(repoRoot,modFileName) : new File(modFileName); + File modFile = repoRoot != null ? new File(repoRoot,modFileName) : new File(modFileName); if (!modFile.exists()) { FMLRelaunchLog.info("Failed to find mod file %s (%s)", descriptor, modFile.getAbsolutePath());