Class MyPetApi

java.lang.Object
de.Keyle.MyPet.MyPetApi

public class MyPetApi extends Object
Static entry point to the MyPet API: every manager, service and hook an addon can reach is reached through one of the accessors here.

Nothing here works before MyPet's own onEnable has run. Declare softdepend: [MyPet] in your plugin.yml, call from your own onEnable rather than onLoad or a constructor, and guard optional paths with isReady(). Reaching for a manager too early throws IllegalStateException with an explanation rather than returning null.

  • Constructor Details

    • MyPetApi

      public MyPetApi()
      Not intended for instantiation -- every member of this class is static. Declared only so the generated documentation has a constructor to describe.
  • Method Details

    • getPlugin

      public static MyPetPlugin getPlugin()
      Returns the running MyPet plugin.
      Returns:
      the main plugin instance
    • setPlugin

      protected static void setPlugin(MyPetPlugin plugin)
      Binds the plugin instance. The first call wins; later calls are ignored.
      Parameters:
      plugin - the running plugin
    • isReady

      public static boolean isReady()
      Reports whether the API is usable yet.
      Returns:
      true if MyPet has loaded and the API is safe to call
    • getLogger

      public static Logger getLogger()
      Returns MyPet's logger, falling back to a standalone one named MyPet before the plugin has loaded.
      Returns:
      the pluginlogger or a logger instance called MyPet
    • getErrorReporter

      public static ErrorReporter getErrorReporter()
      Returns the error reporter.
      Returns:
      instance of the error reporter
    • getPetInfo

      public static PetInfo getPetInfo()
      Returns the per-type pet metadata registry.
      Returns:
      you can find info about pet types here
    • getPlayerManager

      public static PlayerManager getPlayerManager()
      Returns the manager for pet owners.
      Returns:
      MyPet player manager
    • getPetManager

      public static PetManager getPetManager()
      Returns the manager for active and stored pets.
      Returns:
      Pet manager
    • getHookHelper

      public static HookHelper getHookHelper()
      Returns the facade over MyPet's third-party plugin integrations.
      Returns:
      you can find plugin hook helper functions here
    • getServiceManager

      public static ServiceManager getServiceManager()
      Returns the service manager.
      Returns:
      instance of the service manager
    • getSkilltreeManager

      public static SkilltreeManager getSkilltreeManager()
      Returns the skilltree manager.
      Returns:
      instance of the skilltree manager
    • getSkillManager

      public static SkillManager getSkillManager()
      Returns the skill manager.
      Returns:
      instance of the skill manager
    • getLeashFlagManager

      public static LeashFlagManager getLeashFlagManager()
      Returns the leash-flag manager.
      Returns:
      instance of the leashflag manager
    • getGuiService

      public static GuiService getGuiService()
      Returns the menu service.
      Returns:
      instance of the GUI service
    • getDialogService

      public static DialogService getDialogService()
      Returns the prompt service.
      Returns:
      instance of the dialog service