Class NeoForgeCoreLoader
java.lang.Object
mods.thecomputerizer.theimpossiblelibrary.neoforge.core.NeoForgeCoreLoader
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 layerstatic voidExport the given module to all packages loaded to a module in the GAME layerstatic Object[]findModuleLoaderForPackage(String pkg, ClassLoader[] loaders) Returns an array where the elements are the ClassLoader, resolved module, and the name of the layer.static voidstatic voidfixService(String service, String impl, ClassLoader loaderFrom) static voidfixService(String service, String impl, ClassLoader loaderFrom, boolean isRemoval) static Objectstatic ModulegetModuleFromPackage(String pkg, String layerName, boolean newFormat) static ObjectinitCoreAPI(ClassLoader loader) Returns a CoreAPI instance on the input ClassLoader.static ClassLoaderlayerClassLoader(String name) Tries to get the ClassLoader instance associated with the given layer namestatic voidmoveModuleToLayer(ClassLoader targetLoader, String layerTo, String layerFrom, String moduleName) static voidnukeAndFinalize(net.neoforged.neoforgespi.language.IModInfo mod, String pkg, Set<String> finalizedPkgs) Add the module for the given package to the GAME layer and nuke all references to it from other layersstatic 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.neoforged.neoforgespi.language.IModInfo info, ModuleLayer layer)
-
Constructor Details
-
NeoForgeCoreLoader
public NeoForgeCoreLoader()
-
-
Method Details
-
bootLoader
Should be the ClassLoader for the BOOT layer -
exportAllModules
-
findModuleLoaderForPackage
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 -
fixForServiceLayer
public static void fixForServiceLayer() -
fixService
-
fixService
public static void fixService(String service, String impl, ClassLoader loaderFrom, boolean isRemoval) -
getBootLoadedCoreAPI
-
getModuleFromPackage
-
initCoreAPI
Returns a CoreAPI instance on the input ClassLoader. Initializes the source if necessary -
layerClassLoader
Tries to get the ClassLoader instance associated with the given layer name -
moveModuleToLayer
public static void moveModuleToLayer(ClassLoader targetLoader, String layerTo, String layerFrom, String moduleName) -
nukeAndFinalize
-
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
public static void verifyModule(String className, net.neoforged.neoforgespi.language.IModInfo info, ModuleLayer layer) throws Exception - Throws:
Exception
-