diff --git a/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java b/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java index 1afaf1c807..a072127afc 100644 --- a/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java +++ b/src/main/java/net/minecraftforge/fml/client/FMLClientHandler.java @@ -204,10 +204,10 @@ public class FMLClientHandler implements IFMLSidedHandler return; } - FMLCommonHandler.instance().beginLoading(this); + List injectedModContainers = FMLCommonHandler.instance().beginLoading(this); try { - Loader.instance().loadMods(); + Loader.instance().loadMods(injectedModContainers); } catch (WrongMinecraftVersionException wrong) { diff --git a/src/main/java/net/minecraftforge/fml/common/FMLCommonHandler.java b/src/main/java/net/minecraftforge/fml/common/FMLCommonHandler.java index f135488c15..7e181d8ed9 100644 --- a/src/main/java/net/minecraftforge/fml/common/FMLCommonHandler.java +++ b/src/main/java/net/minecraftforge/fml/common/FMLCommonHandler.java @@ -140,11 +140,12 @@ public class FMLCommonHandler return eventBus; } - public void beginLoading(IFMLSidedHandler handler) + public List beginLoading(IFMLSidedHandler handler) { sidedDelegate = handler; MinecraftForge.initialize(); // MinecraftForge.registerCrashCallable(); + return ImmutableList.of(); } /** diff --git a/src/main/java/net/minecraftforge/fml/common/Loader.java b/src/main/java/net/minecraftforge/fml/common/Loader.java index 0e608367e5..e2771f3450 100644 --- a/src/main/java/net/minecraftforge/fml/common/Loader.java +++ b/src/main/java/net/minecraftforge/fml/common/Loader.java @@ -26,14 +26,11 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.ICrashReportDetail; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.fml.common.LoaderState.ModState; import net.minecraftforge.fml.common.ModContainer.Disableable; import net.minecraftforge.fml.common.ProgressManager.ProgressBar; -import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData; import net.minecraftforge.fml.common.discovery.ModDiscoverer; import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.event.FMLLoadEvent; @@ -338,8 +335,9 @@ public class Loader * Finally, if they are successfully loaded as classes, they are then added * to the available mod list. */ - private ModDiscoverer identifyMods() + private ModDiscoverer identifyMods(List additionalContainers) { + injectedContainers.addAll(additionalContainers); FMLLog.fine("Building injected Mod Containers %s", injectedContainers); // Add in the MCP mod container mods.add(new InjectedModContainer(mcp,new File("minecraft.jar"))); @@ -487,8 +485,9 @@ public class Loader * Called from the hook to start mod loading. We trigger the * {@link #identifyMods()} and Constructing, Preinitalization, and Initalization phases here. Finally, * the mod list is frozen completely and is consider immutable from then on. + * @param injectedModContainers */ - public void loadMods() + public void loadMods(List injectedModContainers) { progressBar = ProgressManager.push("Loading", 7); progressBar.step("Constructing Mods"); @@ -497,7 +496,7 @@ public class Loader namedMods = Maps.newHashMap(); modController = new LoadController(this); modController.transition(LoaderState.LOADING, false); - discoverer = identifyMods(); + discoverer = identifyMods(injectedModContainers); ModAPIManager.INSTANCE.manageAPI(modClassLoader, discoverer); disableRequestedMods(); modController.distributeStateMessage(FMLLoadEvent.class); diff --git a/src/main/java/net/minecraftforge/fml/server/FMLServerHandler.java b/src/main/java/net/minecraftforge/fml/server/FMLServerHandler.java index 7d82c64d78..d292218a5f 100644 --- a/src/main/java/net/minecraftforge/fml/server/FMLServerHandler.java +++ b/src/main/java/net/minecraftforge/fml/server/FMLServerHandler.java @@ -13,7 +13,6 @@ package net.minecraftforge.fml.server; import java.io.*; -import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -74,22 +73,22 @@ public class FMLServerHandler implements IFMLSidedHandler * A reference to the server itself */ private MinecraftServer server; - + private List injectedModContainers; private FMLServerHandler() { - FMLCommonHandler.instance().beginLoading(this); + injectedModContainers = FMLCommonHandler.instance().beginLoading(this); } /** * Called to start the whole game off from * {@link MinecraftServer#startServer} * - * @param minecraftServer + * @param minecraftServer server */ @Override public void beginServerLoading(MinecraftServer minecraftServer) { server = minecraftServer; - Loader.instance().loadMods(); + Loader.instance().loadMods(injectedModContainers); Loader.instance().preinitializeMods(); }