Class ModDiscoverer.DiscoveryPipeline
java.lang.Object
net.neoforged.fml.loading.moddiscovery.ModDiscoverer.DiscoveryPipeline
- All Implemented Interfaces:
IIssueReporting,IDiscoveryPipeline
- Enclosing class:
ModDiscoverer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ModFileDiscoveryAttributesprivate intprivate final List<ModLoadingIssue> private intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryPipeline(ModFileDiscoveryAttributes defaultAttributes, List<ModFile> loadedFiles, List<ModLoadingIssue> issues) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIssue(ModLoadingIssue issue) Report an issue to the loader.addJarContent(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting) booleanaddModFile(IModFile mf) Add a pre-created mod file to the discovery pipeline.addPath(List<Path> groupedPaths, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting) @Nullable IModFilereadModFile(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes) Use the registered readers to attempt to create a mod-file from the given jar contents.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforgespi.locating.IDiscoveryPipeline
addPath
-
Field Details
-
defaultAttributes
-
loadedFiles
-
issues
-
successCount
private int successCount -
errorCount
private int errorCount -
warningCount
private int warningCount -
skipCount
private int skipCount
-
-
Constructor Details
-
DiscoveryPipeline
public DiscoveryPipeline(ModFileDiscoveryAttributes defaultAttributes, List<ModFile> loadedFiles, List<ModLoadingIssue> issues)
-
-
Method Details
-
addPath
public Optional<IModFile> addPath(List<Path> groupedPaths, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting) Description copied from interface:IDiscoveryPipelineAdds a group of files or folders to the discovery pipeline, to be further processed by registered readers into a mod file.- Specified by:
addPathin interfaceIDiscoveryPipeline- 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:IDiscoveryPipelineUse the registered readers to attempt to create a mod-file from the given jar contents.- Specified by:
readModFilein interfaceIDiscoveryPipeline- 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:IDiscoveryPipelineAdds a pre-createdjarto the discovery pipeline to be further processed by registered readers into a mod file.- Specified by:
addJarContentin interfaceIDiscoveryPipeline- 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
Description copied from interface:IDiscoveryPipelineAdd a pre-created mod file to the discovery pipeline.- Specified by:
addModFilein interfaceIDiscoveryPipeline- Parameters:
mf- The mod file. This must not be a custom implementation ofIModFile. Use the static factory methods onIModFileinstead.- Returns:
- True if the file was successfully added.
-
addIssue
Description copied from interface:IIssueReportingReport an issue to the loader.- Specified by:
addIssuein interfaceIIssueReporting
-