Finish up classloading system. Use ModJARURL to locate resources

and enable ModLauncher to use those instead. This allows all mods to load
within the scope of the game classloader, removing weird conflicts and
class discovery problems.
This commit is contained in:
cpw committed 2019-01-04 23:56:10 -05:00
1 parent 6baddc7e26
commit fd9c83b65f
21 files changed
+360 -144

No files matched your search

@@ -19,6 +19,7 @@
package net.minecraftforge.fml;
import cpw.mods.modlauncher.TransformingClassLoader;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.common.MinecraftForge;
@@ -40,12 +41,13 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import static net.minecraftforge.fml.Logging.CORE;
import static net.minecraftforge.fml.Logging.LOADING;
public class ModLoader
{
private static final Logger LOGGER = LogManager.getLogger();
private static ModLoader INSTANCE;
private final ClassLoader launchClassLoader;
private final TransformingClassLoader launchClassLoader;
private final LoadingModList loadingModList;
private final ModLoadingClassLoader modClassLoader;
@@ -112,6 +114,7 @@ public class ModLoader
{
final Map<String, IModInfo> modInfoMap = modFile.getModFileInfo().getMods().stream().collect(Collectors.toMap(IModInfo::getModId, Function.identity()));
LOGGER.debug(LOADING, "ModContainer is {}", ModContainer.class.getClassLoader());
return modFile.getScanResult().getTargets().entrySet().stream().
map(e-> {
try {