Class HookManager

java.lang.Object
us.talabrek.ultimateskyblock.hook.HookManager

public class HookManager extends Object
  • Constructor Details

    • HookManager

      public HookManager(@NotNull @NotNull uSkyBlock plugin)
  • Method Details

    • getHook

      public Optional<PluginHook> getHook(String hook)
      Returns an Optional containing the requested PluginHook, or null if the hook is not available.
      Parameters:
      hook - Name of the requested hook.
      Returns:
      Optional containing the requested PluginHook, or null if unavailable.
    • getEconomyHook

      public Optional<EconomyHook> getEconomyHook()
      Short method for getHook(String) to get the optional EconomyHook.
      Returns:
      optional of EconomyHook.
    • getMultiverse

      public Optional<MultiverseHook> getMultiverse()
      Short method for getHook(String) to get the optional MultiverseHook.
      Returns:
      optional of MultiverseHook.
    • getPermissionsHook

      public Optional<PermissionsHook> getPermissionsHook()
      Short method for getHook(String) to get the optional PermissionsHook.
      Returns:
      optional of PermissionsHook.
    • registerHook

      public void registerHook(PluginHook hook) throws HookFailedException
      Tries to enable the hook in the given PluginHook. Adds the plugin hook to the list of enabled hooks if successfull. Throws a HookFailedException otherwise.
      Parameters:
      hook - Hook to enable and register.
      Throws:
      HookFailedException - if hooking into the plugin failes.
    • setupEconomyHook

      public boolean setupEconomyHook()
      Checks and hooks if there are compatible Economy plugins available.
      Returns:
      True if a compatible Economy plugin has been found and hooking succeeded, false otherwise.
    • setupMultiverse

      public boolean setupMultiverse()
      Checks and hooks into Multiverse-Core.
      Returns:
      True if hooking succeeded, false otherwise.
    • setupPermissionsHook

      public boolean setupPermissionsHook()
      Checks and hooks if there are compatible Permissions plugins available.
      Returns:
      True if a compatible Permissions plugin has geen found and hooking succeeded, false otherwise.