Class ZentrixProvider
For addon developers: Use ZentrixAPI.get() instead of this class.
The static methods on ZentrixAPI are the recommended way to access the API.
Recommended Usage
// Use ZentrixAPI.get() instead (recommended)
ZentrixAPI api = ZentrixAPI.get();
api.getGameService().getActiveGames();
When to use ZentrixProvider directly
This class is primarily used internally by the Zentrix core plugin and the
invalid reference
ZentrixAddon
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ZentrixAPIget()Gets the ZentrixAPI instance.static booleanChecks if the ZentrixAPI is available.static voidregister(@NotNull ZentrixAPI api) Registers the API implementation.static voidUnregisters the API implementation.
-
Method Details
-
get
Gets the ZentrixAPI instance.Prefer using
ZentrixAPI.get()instead.- Returns:
- The API instance
- Throws:
IllegalStateException- if the API has not been initialized yet- See Also:
-
isAvailable
public static boolean isAvailable()Checks if the ZentrixAPI is available.Prefer using
ZentrixAPI.isAvailable()instead.- Returns:
trueif the API is initialized and ready to use- See Also:
-
register
Registers the API implementation.Internal method - DO NOT CALL FROM ADDONS.
This method is called by the Zentrix core plugin during startup to register the API implementation. Calling this from an addon will have no effect and may cause issues.
- Parameters:
api- The API implementation to register- Throws:
IllegalArgumentException- if api is nullIllegalStateException- if API is already registered
-
unregister
public static void unregister()Unregisters the API implementation.Internal method - DO NOT CALL FROM ADDONS.
This method is called by the Zentrix core plugin during shutdown to unregister the API implementation.
-