java.lang.Object
mods.thecomputerizer.theimpossiblelibrary.neoforge.core.loader.NeoForgeModLoading

public class NeoForgeModLoading extends Object
Helper methods for common functionalities between all 1.20.4+ versions of NeoForge mod loading
  • Constructor Details

    • NeoForgeModLoading

      public NeoForgeModLoading()
  • Method Details

    • buildJarContents

      public static cpw.mods.jarhandling.JarContents buildJarContents(String moduleName, Path... paths)
    • createDiscoveryAttributes

      public static Object createDiscoveryAttributes(Object readerOrLocator)
    • createLoaderManfiest

      public static Supplier<Manifest> createLoaderManfiest(Path sourcePath)
    • createLoaderFiles

      public static net.neoforged.neoforgespi.locating.IModFile[] createLoaderFiles(cpw.mods.jarhandling.JarContents[] contents, Object locator, mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionModCandidate candidate, Collection<?> infos)
      Create separate LIBRARY and MOD type mod files for this library. This should only be called from TILSelfLocator in 1.20.6+
    • createModFile

      public static net.neoforged.neoforgespi.locating.IModFile createModFile(Object pathOrJarContents, Object locator, mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionModCandidate candidate, Collection<?> infos, net.neoforged.neoforgespi.locating.IModFile.Type type)
    • findManifest

      public static Optional<Manifest> findManifest(Path path)
    • findManifest

      public static Optional<Manifest> findManifest(Path path, @Nullable @Nullable Supplier<Manifest> fallback)
    • findPaths

      public static void findPaths(ClassLoader classLoader, mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionLoaderAPI loader)
    • getFileInfo

      public static net.neoforged.neoforgespi.language.IModFileInfo getFileInfo(net.neoforged.neoforgespi.locating.IModFile file, Collection<?> infos)
      Also initializes the info map
    • getModFileType

      public static net.neoforged.neoforgespi.locating.IModFile.Type getModFileType(String name)
    • identifyMods

      public static boolean identifyMods(net.neoforged.neoforgespi.locating.IModFile file)
      Called via ASM from the generated ModFile extension
    • initFileConfig

      public static net.neoforged.neoforgespi.language.IConfigurable initFileConfig(Collection<?> infos)
    • initModLoading

      public static void initModLoading(ClassLoader loader, Object locator)
    • langProviderConfig

      public static com.electronwill.nightconfig.core.Config langProviderConfig()
    • langProviderModFile

      public static net.neoforged.neoforgespi.locating.IModFile langProviderModFile(net.neoforged.neoforgespi.locating.IModFile reference, String moduleName)
    • populateMultiversionData

      public static void populateMultiversionData(Map<mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionModInfo,mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionModData> infoMap, Map<String,mods.thecomputerizer.theimpossiblelibrary.api.core.loader.MultiVersionModData> dataMap)
    • queryCoreMods

      public static void queryCoreMods(String... resourcePaths)
      Called via ASM from the generated ModFile extension
    • queryCoreMods

      public static void queryCoreMods(Object file)
    • scanMods

      public static <F> List<F> scanMods()
      Returns the list of mods
    • setLoadingVersion

      public static boolean setLoadingVersion(Class<?> caller)
      Returns false if the version was not set correctly
    • updateDiscoveryAttributes

      public static void updateDiscoveryAttributes(net.neoforged.neoforgespi.locating.IModFile file, String method, Object updateWith)
    • updateDiscoveryAttributes

      public static Object updateDiscoveryAttributes(Object attributes, String method, Object updateWith)
    • writeMods

      public static net.neoforged.neoforgespi.language.ModFileScanData writeMods(net.neoforged.fml.loading.moddiscovery.ModFile file)
      Called via the dynamically generated ModFile extension class