Package de.Keyle.MyPet
Class MyPetApi
java.lang.Object
de.Keyle.MyPet.MyPetApi
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 Summary
ConstructorsConstructorDescriptionMyPetApi()Not intended for instantiation -- every member of this class is static. -
Method Summary
Modifier and TypeMethodDescriptionstatic DialogServiceReturns the prompt service.static ErrorReporterReturns the error reporter.static GuiServiceReturns the menu service.static HookHelperReturns the facade over MyPet's third-party plugin integrations.static LeashFlagManagerReturns the leash-flag manager.static LoggerReturns MyPet's logger, falling back to a standalone one namedMyPetbefore the plugin has loaded.static PetInfoReturns the per-type pet metadata registry.static PetManagerReturns the manager for active and stored pets.static PlayerManagerReturns the manager for pet owners.static MyPetPluginReturns the running MyPet plugin.static ServiceManagerReturns the service manager.static SkillManagerReturns the skill manager.static SkilltreeManagerReturns the skilltree manager.static booleanisReady()Reports whether the API is usable yet.protected static voidsetPlugin(MyPetPlugin plugin) Binds the plugin instance.
-
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
Returns the running MyPet plugin.- Returns:
- the main plugin instance
-
setPlugin
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:
trueif MyPet has loaded and the API is safe to call
-
getLogger
Returns MyPet's logger, falling back to a standalone one namedMyPetbefore the plugin has loaded.- Returns:
- the pluginlogger or a logger instance called MyPet
-
getErrorReporter
Returns the error reporter.- Returns:
- instance of the error reporter
-
getPetInfo
Returns the per-type pet metadata registry.- Returns:
- you can find info about pet types here
-
getPlayerManager
Returns the manager for pet owners.- Returns:
- MyPet player manager
-
getPetManager
Returns the manager for active and stored pets.- Returns:
- Pet manager
-
getHookHelper
Returns the facade over MyPet's third-party plugin integrations.- Returns:
- you can find plugin hook helper functions here
-
getServiceManager
Returns the service manager.- Returns:
- instance of the service manager
-
getSkilltreeManager
Returns the skilltree manager.- Returns:
- instance of the skilltree manager
-
getSkillManager
Returns the skill manager.- Returns:
- instance of the skill manager
-
getLeashFlagManager
Returns the leash-flag manager.- Returns:
- instance of the leashflag manager
-
getGuiService
Returns the menu service.- Returns:
- instance of the GUI service
-
getDialogService
Returns the prompt service.- Returns:
- instance of the dialog service
-