Interface Hook<P>

Type Parameters:
P - The plugin class which this hook is for

public interface Hook<P>
Represents a hook
  • Method Summary

    Modifier and Type
    Method
    Description
    The parent plugin of this hook
    default int
    The version of this hook.
    Get the name of this hook
    default void
    Do some extra registration which this hook might require to work.
    default void
    Do some extra unregistration which this hook might require to be properly cleaned up.
  • Method Details

    • getHooked

      P getHooked()
      The parent plugin of this hook
      Returns:
      The parent plugin
    • getName

      String getName()
      Get the name of this hook
      Returns:
      The name of this hook; usually the name of the hooked plugin
    • getHookVersion

      default int getHookVersion()
      The version of this hook. This might be useful for some.
      Returns:
      The version of this hook; defaults to 0
    • register

      default void register()
      Do some extra registration which this hook might require to work. E.g. registering event listeners
    • unregister

      default void unregister()
      Do some extra unregistration which this hook might require to be properly cleaned up. E.g. unregistering event listeners