Class ModClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
com.hloader.mod.ModClassLoader
- All Implemented Interfaces:
Closeable, AutoCloseable
One instance per mod jar, so two mods bundling different (and differently-versioned) copies of
the same library never collide - each mod's own dependency classes are only ever visible
through its own loader, not to any other mod.
This can't isolate everything: hloader's agent transforms game classes in place rather than loading them through a custom classloader, so any class a mixin weaves into a game class - the mixin's own class, and anything its injected method body references - still resolves through whatever classloader actually defines that game class (the shared parent), not this mod's own loader. What this isolates is a mod's "normal" code - its entrypoint and anything only it calls into directly - which is where real dependency collisions between mods actually happen.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class SecureClassLoader
defineClass, defineClassMethods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ModClassLoader
-
-
Method Details
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-