Interface IDiscoveryPipeline

All Superinterfaces:
IIssueReporting
All Known Implementing Classes:
ModDiscoverer.DiscoveryPipeline

@NonExtendable public interface IDiscoveryPipeline extends IIssueReporting
Offers services to locators for adding mod files in various stages to the discovery pipeline.
  • Method Details

    • addPath

      default Optional<IModFile> addPath(Path path, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting incompatibleFileReporting)
      Adds a single file or folder to the discovery pipeline, to be further processed by registered readers into a mod file.
      Parameters:
      path - The path
      attributes - Additional attributes that describe the circumstance of how this path was discovered.
      incompatibleFileReporting - 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.
    • addPath

      Optional<IModFile> addPath(List<Path> groupedPaths, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting incompatibleFileReporting)
      Adds a group of files or folders to the discovery pipeline, to be further processed by registered readers into a mod file.
      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.
      incompatibleFileReporting - 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.
    • addJarContent

      Optional<IModFile> addJarContent(cpw.mods.jarhandling.JarContents contents, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting incompatibleFileReporting)
      Adds a pre-created jar to the discovery pipeline to be further processed by registered readers into a mod file.
      Parameters:
      contents - The contents of the mod file.
      attributes - Additional attributes that describe the circumstance of how this path was discovered.
      incompatibleFileReporting - 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

      boolean addModFile(IModFile modFile)
      Add a pre-created mod file to the discovery pipeline.
      Parameters:
      modFile - 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.
    • readModFile

      @Nullable @Nullable IModFile readModFile(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes)
      Use the registered readers to attempt to create a mod-file from the given jar contents.
      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.