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 Stringstatic StringidentifySourcePath(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> loadEarlyServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) Same asloadServices(net.neoforged.neoforgespi.ILaunchContext, java.lang.Class<T>), but it also marks any jar file that provided such services as located to prevent it from being located again as a mod-file or library later.static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass) static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices, Predicate<Class<? extends T>> filter) static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Predicate<Class<? extends T>> filter)
-
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, Predicate<Class<? extends T>> filter) -
loadServices
public static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) -
loadEarlyServices
public static <T> List<T> loadEarlyServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices) Same asloadServices(net.neoforged.neoforgespi.ILaunchContext, java.lang.Class<T>), but it also marks any jar file that provided such services as located to prevent it from being located again as a mod-file or library later. -
loadServices
public static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass, Collection<T> additionalServices, Predicate<Class<? extends T>> filter) - 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.
-