Class AlpineIntegration

java.lang.Object
co.crystaldev.alpinecore.framework.integration.AlpineIntegration
All Implemented Interfaces:
Activatable, org.bukkit.event.Listener
Direct Known Subclasses:
VaultIntegration

public abstract class AlpineIntegration extends Object implements org.bukkit.event.Listener, Activatable
A wrapper for AlpineEngine logic that will only activate if a provided activation condition is satisfied.

Primarily used for allowing for easy soft-depending on other plugins.

Inheritors should never be manually instantiated.

Since:
0.1.0
  • Field Details

    • plugin

      protected final AlpinePlugin plugin
      The plugin that activated this engine
  • Constructor Details

    • AlpineIntegration

      protected AlpineIntegration(AlpinePlugin plugin)
      Locked down to prevent improper instantiation.

      Integrations are reflectively instantiated by the framework automatically.

  • Method Details

    • shouldActivate

      protected abstract boolean shouldActivate()
      Sets the activation condition for the integration.
      Returns:
      Whether the integration should be activated
    • getEngineClass

      @NotNull protected abstract @NotNull Class<? extends AlpineIntegrationEngine> getEngineClass()
      Returns:
      The class of the engine for this integration
    • activate

      public final void activate(@NotNull @NotNull AlpinePlugin context)
      Description copied from interface: Activatable
      Activate this object.
      Specified by:
      activate in interface Activatable
      Parameters:
      context - The plugin which initiated the request
    • deactivate

      public final void deactivate(@NotNull @NotNull AlpinePlugin context)
      Description copied from interface: Activatable
      Deactivate this object.
      Specified by:
      deactivate in interface Activatable
      Parameters:
      context - The plugin which initiated the request
    • isActive

      public final boolean isActive()
      Description copied from interface: Activatable
      Is this object active?
      Specified by:
      isActive in interface Activatable
      Returns:
      Whether the object is active
    • onPluginEnabled

      public final void onPluginEnabled(org.bukkit.event.server.PluginEnableEvent event)
    • onPluginDisabled

      public final void onPluginDisabled(org.bukkit.event.server.PluginDisableEvent event)
    • checkActivation

      protected final void checkActivation()
      Accessible to allow plugins to utilize integrations for purposes other than soft-depending on other plugins.

      Do not call this unless you know what you're doing.