Record Class PathBasedLocator
java.lang.Object
java.lang.Record
net.neoforged.fml.loading.moddiscovery.locators.PathBasedLocator
- All Implemented Interfaces:
IModFileCandidateLocator,IOrderedProvider
public record PathBasedLocator(String name, List<Path> paths)
extends Record
implements IModFileCandidateLocator
"Locates" mods from a fixed set of paths.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thenamerecord component.The field for thepathsrecord component.Fields inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
DEFAULT_PRIORITY, HIGHEST_SYSTEM_PRIORITY, LOWEST_SYSTEM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionPathBasedLocator(String name, Path... paths) PathBasedLocator(String name, List<Path> paths) Creates an instance of aPathBasedLocatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidfindCandidates(ILaunchContext context, IDiscoveryPipeline pipeline) Discovers potential mods to be loaded by FML.intGets the priority in which this provider will be called.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.paths()Returns the value of thepathsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
name
The field for thenamerecord component. -
paths
The field for thepathsrecord component.
-
-
Constructor Details
-
PathBasedLocator
-
PathBasedLocator
Creates an instance of aPathBasedLocatorrecord class.- Parameters:
name- the value for thenamerecord componentpaths- the value for thepathsrecord component
-
-
Method Details
-
findCandidates
Description copied from interface:IModFileCandidateLocatorDiscovers potential mods to be loaded by FML.- Specified by:
findCandidatesin interfaceIModFileCandidateLocator- Parameters:
pipeline- Adds discovered mods and issues to this pipeline.
-
getPriority
public int getPriority()Description copied from interface:IOrderedProviderGets the priority in which this provider will be called. A higher value means the provider will be called earlier.- Specified by:
getPriorityin interfaceIOrderedProvider
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
paths
Returns the value of thepathsrecord component.- Returns:
- the value of the
pathsrecord component
-