Class Services

java.lang.Object
fr.pacdu.pacpackquests.platform.Services

public final class Services extends Object
Service locator using the Java ServiceLoader API to dynamically bind loader-specific implementations (Fabric, NeoForge) at runtime without creating compile-time coupling in the common module.
  • Field Details

    • PLATFORM

      public static final IPlatformHelper PLATFORM
      The platform service instance providing environment and mod-loading utilities.
    • NETWORK

      public static final INetworkHelper NETWORK
      The network service instance providing client and server packet dispatchers.
  • Method Details

    • load

      public static <T> T load(Class<T> clazz)
      Loads the first available service implementation for the given service interface.
      Type Parameters:
      T - The service interface type.
      Parameters:
      clazz - The class object representing the service interface.
      Returns:
      The loaded service implementation.
      Throws:
      NullPointerException - if no provider is found in META-INF/services.