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 ModFileDiscoveryAttributes
private int
private final List
<ModLoadingIssue> private int
private int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryPipeline
(ModFileDiscoveryAttributes defaultAttributes, List<ModFile> loadedFiles, List<ModLoadingIssue> issues) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIssue
(ModLoadingIssue issue) Report an issue to the loader.addJarContent
(cpw.mods.jarhandling.JarContents jarContents, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting) boolean
addModFile
(IModFile mf) Add a pre-created mod file to the discovery pipeline.addPath
(List<Path> groupedPaths, ModFileDiscoveryAttributes attributes, IncompatibleFileReporting reporting) @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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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: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 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:IDiscoveryPipeline
Use the registered readers to attempt to create a mod-file from the given jar contents.- Specified by:
readModFile
in 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:IDiscoveryPipeline
Adds a pre-createdjar
to the discovery pipeline to be further processed by registered readers into a mod file.- Specified by:
addJarContent
in 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:IDiscoveryPipeline
Add a pre-created mod file to the discovery pipeline.- Specified by:
addModFile
in interfaceIDiscoveryPipeline
- Parameters:
mf
- The mod file. This must not be a custom implementation ofIModFile
. Use the static factory methods onIModFile
instead.- Returns:
- True if the file was successfully added.
-
addIssue
Description copied from interface:IIssueReporting
Report an issue to the loader.- Specified by:
addIssue
in interfaceIIssueReporting
-