Package fr.pacdu.pacpackquests.platform
Class Services
java.lang.Object
fr.pacdu.pacpackquests.platform.Services
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final INetworkHelperThe network service instance providing client and server packet dispatchers.static final IPlatformHelperThe platform service instance providing environment and mod-loading utilities. -
Method Summary
-
Field Details
-
PLATFORM
The platform service instance providing environment and mod-loading utilities. -
NETWORK
The network service instance providing client and server packet dispatchers.
-
-
Method Details
-
load
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.
-