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 Summary
Modifier and TypeFieldDescriptionprotected final AlpinePlugin
The plugin that activated this engine -
Constructor Summary
ModifierConstructorDescriptionprotected
AlpineIntegration
(AlpinePlugin plugin) Locked down to prevent improper instantiation. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
activate
(@NotNull AlpinePlugin context) Activate this object.protected final void
Accessible to allow plugins to utilize integrations for purposes other than soft-depending on other plugins.final void
deactivate
(@NotNull AlpinePlugin context) Deactivate this object.protected abstract @NotNull Class<? extends AlpineIntegrationEngine>
final boolean
isActive()
Is this object active?final void
onPluginDisabled
(org.bukkit.event.server.PluginDisableEvent event) final void
onPluginEnabled
(org.bukkit.event.server.PluginEnableEvent event) protected abstract boolean
Sets the activation condition for the integration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface co.crystaldev.alpinecore.framework.Activatable
canDeactivate
-
Field Details
-
plugin
The plugin that activated this engine
-
-
Constructor Details
-
AlpineIntegration
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
- Returns:
- The class of the engine for this integration
-
activate
Description copied from interface:Activatable
Activate this object.- Specified by:
activate
in interfaceActivatable
- Parameters:
context
- The plugin which initiated the request
-
deactivate
Description copied from interface:Activatable
Deactivate this object.- Specified by:
deactivate
in interfaceActivatable
- 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 interfaceActivatable
- 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.
-