Class APIProvider

java.lang.Object
net.godlycow.org.essc.api.APIProvider

public final class APIProvider extends Object
How you get the API. EssentialsC registers itself on enable, so just check isAvailable() before calling get().
  • Method Details

    • register

      public static void register(EssentialsCAPI api)
      Registers the API instance. Only EssentialsC itself calls this.
      Parameters:
      api - the implementation to expose
      Throws:
      IllegalArgumentException - if api is null
      IllegalStateException - if an instance is already registered
    • unregister

      public static void unregister()
      Clears the registered instance. Only EssentialsC itself calls this.
    • get

      public static EssentialsCAPI 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