Package net.godlycow.org.essc.api
Class APIProvider
java.lang.Object
net.godlycow.org.essc.api.APIProvider
How you get the API. EssentialsC registers itself on enable,
so just check
isAvailable() before calling get().-
Method Summary
Modifier and TypeMethodDescriptionstatic EssentialsCAPIget()Gets the API instance.static booleanChecks if the API is ready to use.static voidregister(EssentialsCAPI api) Registers the API instance.static voidClears the registered instance.
-
Method Details
-
register
Registers the API instance. Only EssentialsC itself calls this.- Parameters:
api- the implementation to expose- Throws:
IllegalArgumentException- ifapiisnullIllegalStateException- if an instance is already registered
-
unregister
public static void unregister()Clears the registered instance. Only EssentialsC itself calls this. -
get
Gets the API instance.- Returns:
- the API instance
- Throws:
IllegalStateException- if EssentialsC is not loaded
-
isAvailable
public static boolean isAvailable()Checks if the API is ready to use.- Returns:
- true if
get()will work
-