Class ServiceLoaderUtil

java.lang.Object
net.neoforged.fml.util.ServiceLoaderUtil

@Internal public final class ServiceLoaderUtil extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • ServiceLoaderUtil

      private ServiceLoaderUtil()
  • Method Details

    • loadServices

      public static <T> List<T> loadServices(ILaunchContext context, Class<T> serviceClass)
    • 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 as loadServices(ILaunchContext, Class), 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 implements IOrderedProvider, the services will automatically be sorted.
    • identifyService

      private static String identifyService(Object o)
    • identifySourcePath

      public static String identifySourcePath(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.