Class JarModsDotTomlModFileReader

java.lang.Object
net.neoforged.fml.loading.moddiscovery.readers.JarModsDotTomlModFileReader
All Implemented Interfaces:
IModFileReader, IOrderedProvider

public class JarModsDotTomlModFileReader extends Object implements IModFileReader
Responsible for handling mod files that are explicitly marked as mods or libraries via metadata files.
  • Field Details

  • Constructor Details

    • JarModsDotTomlModFileReader

      public JarModsDotTomlModFileReader()
  • Method Details

    • createModFile

      public static IModFile createModFile(cpw.mods.jarhandling.JarContents contents, ModFileDiscoveryAttributes discoveryAttributes)
    • getModType

      @Nullable private static IModFile.Type getModType(cpw.mods.jarhandling.JarContents jar)
    • manifestParser

      public static IModFileInfo manifestParser(IModFile mod)
    • read

      @Nullable public @Nullable IModFile read(cpw.mods.jarhandling.JarContents jar, ModFileDiscoveryAttributes discoveryAttributes)
      Description copied from interface: IModFileReader
      Provides a mod from the given jar.

      Throwing ModLoadingException will report contained issues as the reason for incompatibility to players, unless another reader successfully reads the jar.

      Other thrown exceptions will be reported as errors and cause loading to fail.

      Specified by:
      read in interface IModFileReader
      Parameters:
      jar - the mod jar contents
      discoveryAttributes - The attributes relating to this mod files discovery.
      Returns:
      null if this provider can't handle the given jar, otherwise the mod-file created from the given contents and attributes.
    • toString

      public String toString()
      Overrides:
      toString in class Object