Class BlueLibCommon

java.lang.Object
software.bluelib.BlueLibCommon

public class BlueLibCommon extends Object
A public class responsible for common initialization logic and platform detection.

This class contains utility methods to load services, initialize the mod in developer mode, and determine if the current environment is a development environment.

Key Methods:

  • init() - Initializes BlueLib and logs welcome messages if in developer mode.
  • isDeveloperMode() - Checks if the mod is running in developer mode.
Since:
1.0.0
  • Field Details

    • PLATFORM

      public static final IPlatformHelper PLATFORM
      A public static final IPlatformHelper instance that represents the current platform helper loaded for the mod. This is used to identify platform-specific functionalities.
      Since:
      1.0.0
  • Method Details

    • load

      public static <T> T load(Class<T> pClazz)
      A public static BlueLibCommon that loads a service using ServiceLoader.
      Type Parameters:
      T - The type of the service class to be loaded.
      Parameters:
      pClazz - Class - The class type of the service to load.
      Returns:
      The loaded service instance of type T.
      Throws:
      NullPointerException - if the service cannot be found.
      Since:
      1.0.0
    • init

      public static void init()
      A public static void that initializes BlueLib and logs a thank-you message if in developer mode.
      The message is scheduled to appear after 5 seconds and then the scheduler shuts down.
      Since:
      1.0.0
    • isDeveloperMode

      public static boolean isDeveloperMode()
      A public static Boolean that checks if the mod is running in developer mode.

      Developer mode is active when the mod is not running in a production environment.

      Returns:
      true if running in developer mode, false if it isn't.
      Since:
      1.0.0