Class ModDiscoverer.DiscoveryPipeline

java.lang.Object
net.neoforged.fml.loading.moddiscovery.ModDiscoverer.DiscoveryPipeline
All Implemented Interfaces:
IIssueReporting, IDiscoveryPipeline
Enclosing class:
ModDiscoverer

private class ModDiscoverer.DiscoveryPipeline extends Object implements IDiscoveryPipeline
  • Field Details

    • defaultAttributes

      private final ModFileDiscoveryAttributes defaultAttributes
    • loadedFiles

      private final List<ModFile> loadedFiles
    • issues

      private final List<ModLoadingIssue> issues
    • successCount

      private int successCount
    • errorCount

      private int errorCount
    • warningCount

      private int warningCount
    • skipCount

      private int skipCount
  • Constructor Details

  • Method Details

    • addPath

      public Optional<IModFile> addPath(List<Path> groupedPaths, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting)
      Description copied from interface: IDiscoveryPipeline
      Adds a group of files or folders to the discovery pipeline, to be further processed by registered readers into a mod file.
      Specified by:
      addPath in interface IDiscoveryPipeline
      Parameters:
      groupedPaths - A set of files and folders that are combined into a single virtual Jar file for mod loading.
      attributes - Additional attributes that describe the circumstance of how this path was discovered.
      reporting - The desired behavior if the given file or folder is deemed to be incompatible with NeoForge.
      Returns:
      The resulting mod file if the file or folder was successfully read.
    • readModFile

      @Nullable public @Nullable IModFile readModFile(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes)
      Description copied from interface: IDiscoveryPipeline
      Use the registered readers to attempt to create a mod-file from the given jar contents.
      Specified by:
      readModFile in interface IDiscoveryPipeline
      Parameters:
      attributes - Additional attributes that describe the circumstance of how this path was discovered.
      Returns:
      The created mod file or null if no reader was able to handle the jar contents.
    • addJarContent

      public Optional<IModFile> addJarContent(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting)
      Description copied from interface: IDiscoveryPipeline
      Adds a pre-created jar to the discovery pipeline to be further processed by registered readers into a mod file.
      Specified by:
      addJarContent in interface IDiscoveryPipeline
      Parameters:
      jarContents - The contents of the mod file.
      attributes - Additional attributes that describe the circumstance of how this path was discovered.
      reporting - The desired behavior if the given file or folder is deemed to be incompatible with NeoForge.
      Returns:
      The resulting mod file if the file or folder was successfully read.
    • addModFile

      public boolean addModFile(IModFile mf)
      Description copied from interface: IDiscoveryPipeline
      Add a pre-created mod file to the discovery pipeline.
      Specified by:
      addModFile in interface IDiscoveryPipeline
      Parameters:
      mf - The mod file. This must not be a custom implementation of IModFile. Use the static factory methods on IModFile instead.
      Returns:
      True if the file was successfully added.
    • addIssue

      public void addIssue(ModLoadingIssue issue)
      Description copied from interface: IIssueReporting
      Report an issue to the loader.
      Specified by:
      addIssue in interface IIssueReporting