Class NestedLibraryModReader

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

public class NestedLibraryModReader extends Object implements IModFileReader
This reader will essentially handle all files as plain Java libraries, but will only do so for candidates that are embedded in recognized mod files.

If a plain jar-file (that is not a mod or markes as a library) is present on the classpath or in the mods folder, this is usually a mistake. However, if such a file is embedded in a mod jar, it is usually a deliberate decision by the modder.

  • Constructor Details

    • NestedLibraryModReader

      public NestedLibraryModReader()
  • Method Details

    • 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
    • getPriority

      public int getPriority()
      Description copied from interface: IOrderedProvider
      Gets the priority in which this provider will be called. A higher value means the provider will be called earlier.
      Specified by:
      getPriority in interface IOrderedProvider