Package net.neoforged.fml.util
Class ServiceLoaderUtil
java.lang.Object
net.neoforged.fml.util.ServiceLoaderUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
identifyService
(ILaunchContext context, Object o) static String
identifySourcePath
(ILaunchContext context, Object object) Given any object, this method tries to build a human-readable chain of paths that identify where the code implementing the given object is coming from.static <T> List
<T> loadServices
(ILaunchContext context, Class<T> serviceClass) static <T> List
<T> loadServices
(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) private static String
relativizePath
(ILaunchContext context, Path path) private static String
unwrapPath
(ILaunchContext context, Path path) Tries to unwrap the given path if it is from a nested file-system such as JIJ or UnionFS, while maintaining context in the return (such as "<nested path>" from "<outer jar>").
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ServiceLoaderUtil
private ServiceLoaderUtil()
-
-
Method Details
-
loadServices
-
loadServices
public static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) - Parameters:
serviceClass
- If the service class implementsIOrderedProvider
, the services will automatically be sorted.
-
identifyService
-
identifySourcePath
Given any object, this method tries to build a human-readable chain of paths that identify where the code implementing the given object is coming from. -
unwrapPath
Tries to unwrap the given path if it is from a nested file-system such as JIJ or UnionFS, while maintaining context in the return (such as "<nested path>" from "<outer jar>"). -
relativizePath
-