Package dev.twilite.client.plugins
Class Plugin
java.lang.Object
dev.twilite.client.plugins.Plugin
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
BehaviorPlugin,TickPlugin
Base class for TwiLite plugins.
Plugins are discovered by PluginManager, described with PluginDescriptor,
configured through configure(PluginContext), and then started/stopped by the
plugin lifecycle. Subclasses usually override startUp() and shutDown().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns whether this plugin is currently active.dev.twilite.client.config.ConfigPersistenceControls how this plugin's config is resolved and saved.voidconfigure(com.google.inject.Binder binder) Allows plugins to install plugin-local Guice bindings.voidconfigure(dev.twilite.client.plugins.PluginContext context) Supplies runtime services to this plugin before startup.name()Returns the configured plugin display name, or the class name when no descriptor is present.booleanpaused()Returns whether this plugin is temporarily paused by an interrupt.dev.twilite.client.plugins.scope.PluginScopescope()Returns the scheduling scope for this plugin.
-
Constructor Details
-
Plugin
public Plugin()
-
-
Method Details
-
configure
public void configure(dev.twilite.client.plugins.PluginContext context) Supplies runtime services to this plugin before startup. -
configure
public void configure(com.google.inject.Binder binder) Allows plugins to install plugin-local Guice bindings.- Specified by:
configurein interfacecom.google.inject.Module
-
scope
public dev.twilite.client.plugins.scope.PluginScope scope()Returns the scheduling scope for this plugin. -
configPersistence
public dev.twilite.client.config.ConfigPersistence configPersistence()Controls how this plugin's config is resolved and saved. -
name
Returns the configured plugin display name, or the class name when no descriptor is present. -
active
public boolean active()Returns whether this plugin is currently active. -
paused
public boolean paused()Returns whether this plugin is temporarily paused by an interrupt.
-