Class HookManager
java.lang.Object
us.talabrek.ultimateskyblock.hook.HookManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionShort method forgetHook(String)
to get the optionalEconomyHook
.Returns anOptional
containing the requestedPluginHook
, or null if the hook is not available.Short method forgetHook(String)
to get the optionalMultiverseHook
.Short method forgetHook(String)
to get the optionalPermissionsHook
.void
registerHook
(PluginHook hook) Tries to enable the hook in the givenPluginHook
.boolean
Checks and hooks if there are compatible Economy plugins available.boolean
Checks and hooks into Multiverse-Core.boolean
Checks and hooks if there are compatible Permissions plugins available.
-
Constructor Details
-
HookManager
-
-
Method Details
-
getHook
Returns anOptional
containing the requestedPluginHook
, 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
Short method forgetHook(String)
to get the optionalEconomyHook
.- Returns:
- optional of EconomyHook.
-
getMultiverse
Short method forgetHook(String)
to get the optionalMultiverseHook
.- Returns:
- optional of MultiverseHook.
-
getPermissionsHook
Short method forgetHook(String)
to get the optionalPermissionsHook
.- Returns:
- optional of PermissionsHook.
-
registerHook
Tries to enable the hook in the givenPluginHook
. Adds the plugin hook to the list of enabled hooks if successfull. Throws aHookFailedException
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.
-