diff --git a/client/cpw/mods/fml/client/GuiModList.java b/client/cpw/mods/fml/client/GuiModList.java index acf25a56b6..3293aa5792 100644 --- a/client/cpw/mods/fml/client/GuiModList.java +++ b/client/cpw/mods/fml/client/GuiModList.java @@ -57,7 +57,7 @@ public class GuiModList extends GuiScreen if (mod.getMetadata()!=null && !Strings.isNullOrEmpty(mod.getMetadata().parent)) { String parentMod = mod.getMetadata().parent; ModContainer parentContainer = Loader.instance().getIndexedModList().get(parentMod); - if (parentContainer != null) + if (parentContainer != null && mod.getMetadata().parentMod==null) { mod.getMetadata().parentMod = parentContainer; parentContainer.getMetadata().childMods.add(mod); diff --git a/common/cpw/mods/fml/common/event/FMLPreInitializationEvent.java b/common/cpw/mods/fml/common/event/FMLPreInitializationEvent.java index 6fb4dc9117..0a9d103811 100644 --- a/common/cpw/mods/fml/common/event/FMLPreInitializationEvent.java +++ b/common/cpw/mods/fml/common/event/FMLPreInitializationEvent.java @@ -2,7 +2,9 @@ package cpw.mods.fml.common.event; import java.io.File; import java.util.Properties; +import java.util.logging.Logger; +import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.LoaderState.ModState; import cpw.mods.fml.common.FMLModContainer; import cpw.mods.fml.common.ModContainer; @@ -74,4 +76,16 @@ public class FMLPreInitializationEvent extends FMLStateEvent return null; } + + /** + * Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging! + * + * @return A logger + */ + public Logger getModLog() + { + Logger log = Logger.getLogger(modContainer.getModId()); + log.setParent(FMLLog.getLogger()); + return log; + } } diff --git a/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java b/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java index 073f6ed965..a5f68896ab 100644 --- a/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java +++ b/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java @@ -170,11 +170,11 @@ public class RelaunchLibraryManager if (!download) { - downloadMonitor.updateProgressString("Found library file %s present and correct in lib dir\n", libName); + downloadMonitor.updateProgressString("Found library file %s present and correct in lib dir", libName); } else { - downloadMonitor.updateProgressString("Library file %s was downloaded and verified successfully\n", libName); + downloadMonitor.updateProgressString("Library file %s was downloaded and verified successfully", libName); } try @@ -455,11 +455,9 @@ public class RelaunchLibraryManager { try { - //rootUrl.replace("%s", libFile.getPath()) URL libDownload = new URL(String.format(rootUrl,realFilePath)); - String infoString = String.format("Downloading file %s", libDownload.toString()); - downloadMonitor.updateProgressString(infoString); - FMLRelaunchLog.info(infoString); + downloadMonitor.updateProgressString("Downloading file %s", libDownload.toString()); + FMLRelaunchLog.info("Downloading file %s", libDownload.toString()); URLConnection connection = libDownload.openConnection(); connection.setConnectTimeout(5000); connection.setReadTimeout(5000);