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, Collection<T> additionalServices)
      Parameters:
      serviceClass - If the service class implements IOrderedProvider, the services will automatically be sorted.
    • identifyService

      private static String identifyService(ILaunchContext context, Object o)
    • identifySourcePath

      public 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.
    • unwrapPath

      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>").
    • relativizePath

      private static String relativizePath(ILaunchContext context, Path path)