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 String
The field for thename
record component.The field for thepaths
record 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 aPathBasedLocator
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
findCandidates
(ILaunchContext context, IDiscoveryPipeline pipeline) Discovers potential mods to be loaded by FML.int
Gets the priority in which this provider will be called.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.paths()
Returns the value of thepaths
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record component. -
paths
The field for thepaths
record component.
-
-
Constructor Details
-
PathBasedLocator
-
PathBasedLocator
Creates an instance of aPathBasedLocator
record class.- Parameters:
name
- the value for thename
record componentpaths
- the value for thepaths
record component
-
-
Method Details
-
findCandidates
Description copied from interface:IModFileCandidateLocator
Discovers potential mods to be loaded by FML.- Specified by:
findCandidates
in interfaceIModFileCandidateLocator
- Parameters:
pipeline
- Adds discovered mods and issues to this pipeline.
-
getPriority
public int getPriority()Description copied from interface:IOrderedProvider
Gets the priority in which this provider will be called. A higher value means the provider will be called earlier.- Specified by:
getPriority
in 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 thename
record component.- Returns:
- the value of the
name
record component
-
paths
Returns the value of thepaths
record component.- Returns:
- the value of the
paths
record component
-