Class GameLocator
java.lang.Object
net.neoforged.fml.loading.moddiscovery.locators.GameLocator
- All Implemented Interfaces:
IModFileCandidateLocator,IOrderedProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate static final org.slf4j.Loggerstatic final String[]Fields inherited from interface net.neoforged.neoforgespi.locating.IOrderedProvider
DEFAULT_PRIORITY, HIGHEST_SYSTEM_PRIORITY, LOWEST_SYSTEM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddContentRoot(List<JarContents.FilteredPath> roots, JarContents jarContents, JarContents.PathFilter filter) private static voidaddRequiredLibrary(MavenCoordinate coordinate, List<Path> content) private static JarContents.FilteredPathbuildFilteredMinecraftResourcesFilteredPath(JarContents container, net.neoforged.api.distmarker.Dist requiredDist, RequiredSystemFiles systemFiles) private static StringdetectMinecraftVersion(JarContents mcJarContents) Reads the version.json found in Minecraft jars (both server and client have it) to detect which version of Minecraft is in the given Jar.voidfindCandidates(ILaunchContext context, IDiscoveryPipeline pipeline) Discovers potential mods to be loaded by FML.private static JarContentsgetCombinedMinecraftJar(ILaunchContext context, RequiredSystemFiles systemFiles) private static @Nullable JarContents.PathFiltergetMaskedResourceFilter(JarContents jar, net.neoforged.api.distmarker.Dist requiredDist) private static List<JarContents.FilteredPath> getMinecraftResourcesRoots(ILaunchContext context, RequiredSystemFiles systemFiles) intGets the priority in which this provider will be called.private static voidhandleMergedMinecraftAndNeoForgeJar(ILaunchContext context, IDiscoveryPipeline pipeline, RequiredSystemFiles systemFiles) private static voidlocateProductionMinecraft(ILaunchContext context, IDiscoveryPipeline pipeline) In production, the client and neoforge jars are assembled from partial jars in the libraries folder.private voidpreventLoadingOfObfuscatedClientJar(ILaunchContext context, ClassLoader ourCl) toString()
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
LIBRARIES_DIRECTORY_PROPERTY
- See Also:
-
NEOFORGE_SPECIFIC_PATH_PREFIXES
-
-
Constructor Details
-
GameLocator
public GameLocator()
-
-
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.
-
handleMergedMinecraftAndNeoForgeJar
private static void handleMergedMinecraftAndNeoForgeJar(ILaunchContext context, IDiscoveryPipeline pipeline, RequiredSystemFiles systemFiles) -
getCombinedMinecraftJar
private static JarContents getCombinedMinecraftJar(ILaunchContext context, RequiredSystemFiles systemFiles) -
detectMinecraftVersion
Reads the version.json found in Minecraft jars (both server and client have it) to detect which version of Minecraft is in the given Jar. -
getMinecraftResourcesRoots
private static List<JarContents.FilteredPath> getMinecraftResourcesRoots(ILaunchContext context, RequiredSystemFiles systemFiles) -
buildFilteredMinecraftResourcesFilteredPath
private static JarContents.FilteredPath buildFilteredMinecraftResourcesFilteredPath(JarContents container, net.neoforged.api.distmarker.Dist requiredDist, RequiredSystemFiles systemFiles) -
getMaskedResourceFilter
private static @Nullable JarContents.PathFilter getMaskedResourceFilter(JarContents jar, net.neoforged.api.distmarker.Dist requiredDist) -
addContentRoot
private static void addContentRoot(List<JarContents.FilteredPath> roots, JarContents jarContents, JarContents.PathFilter filter) -
locateProductionMinecraft
In production, the client and neoforge jars are assembled from partial jars in the libraries folder. -
preventLoadingOfObfuscatedClientJar
-
addRequiredLibrary
-
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
-