Class ForgeCoreLoader
java.lang.Object
mods.thecomputerizer.theimpossiblelibrary.forge.core.ForgeCoreLoader
Figures out which version to load on and how to load stuff on it
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoaderShould be the ClassLoader for the BOOT layer or the system ClassLoader if Java 8static voidExport the given module to all packages loaded to a module in the GAME layerstatic Object[]findModuleLoaderForPackage(String pkg, ClassLoader[] loaders, boolean newFormat) Returns an array where the elements are the ClassLoader, resolved module, and the name of the layer.static voidSets up some important stuff needed to initialize the loading process.static Objectstatic ObjectgetModuleFromPackage(String pkg, String layerName, boolean newFormat) static booleanisJava8()static ClassLoaderlayerClassLoader(String name) Tries to get the ClassLoader instance associated with the given layer namestatic StringmoduleName(Object module) static voidmoveModuleToLayer(ClassLoader targetLoader, String layerTo, String layerFrom, String moduleName) static voidnukeAndFinalize(net.minecraftforge.forgespi.language.IModInfo mod, String pkg, Set<String> finalizedPkgs, boolean newFormat) Add the module for the given package to the GAME layer and nuke all references to it from other layersstatic voidnukeAndFinalizeJava8(Set<Class<?>> getSourcesFrom, ClassLoader target, boolean first) Java 8 doesn't have modules, so move all classes loaded from the source of the given package to the target ClassLoader and things should work fine.static voidremoveServiceFrom(String service, String impl, String layer) static voidresyncModules(ClassLoader loaderTo, String layerTo, ClassLoader loaderFrom) Since this class is intially loaded in the SERVICE layer which has BOOT as a parent separate from PLUGIN, we need a workaround for the PLUGIN layer thinking there are duplicate modules.static voidsanityCheckModule(Class<?> c, String name) static Class<?> serviceProviderClass(Object servicesCatalog) static voidverifyModule(String className, net.minecraftforge.forgespi.language.IModInfo info, Object moduleLayer)
-
Constructor Details
-
ForgeCoreLoader
public ForgeCoreLoader()
-
-
Method Details
-
bootLoader
Should be the ClassLoader for the BOOT layer or the system ClassLoader if Java 8 -
exportAllModules
-
findModuleLoaderForPackage
public static Object[] findModuleLoaderForPackage(String pkg, ClassLoader[] loaders, boolean newFormat) Returns an array where the elements are the ClassLoader, resolved module, and the name of the layer. Assumes the given loaders array will always be in the order of BOOT, SERVICE, PLUGIN, GAME -
fixFirstEntryPoint
public static void fixFirstEntryPoint()Sets up some important stuff needed to initialize the loading process. -
getBootLoadedCoreAPI
-
getModuleFromPackage
-
isJava8
public static boolean isJava8() -
layerClassLoader
Tries to get the ClassLoader instance associated with the given layer name -
moduleName
-
moveModuleToLayer
public static void moveModuleToLayer(ClassLoader targetLoader, String layerTo, String layerFrom, String moduleName) -
nukeAndFinalize
-
nukeAndFinalizeJava8
public static void nukeAndFinalizeJava8(Set<Class<?>> getSourcesFrom, ClassLoader target, boolean first) Java 8 doesn't have modules, so move all classes loaded from the source of the given package to the target ClassLoader and things should work fine. Requires generated classes to be excluded from source searching. -
removeServiceFrom
-
resyncModules
Since this class is intially loaded in the SERVICE layer which has BOOT as a parent separate from PLUGIN, we need a workaround for the PLUGIN layer thinking there are duplicate modules. This is needed since IModLanguageProvider implementations are forced into PLUGIN layer from service loading and can likely only be called via reflection. -
sanityCheckModule
-
serviceProviderClass
-
verifyModule
-