Package net.md_5.bungee.api.plugin
Class Plugin
java.lang.Object
net.md_5.bungee.api.plugin.Plugin
Represents any Plugin that may be loaded at runtime to enhance existing
functionality.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPlugin()protectedPlugin(ProxyServer proxy, PluginDescription description) -
Method Summary
Modifier and TypeMethodDescriptionGets the default configurationfinal FileGets the data folder where this plugin may store arbitrary data.Deprecated.getFile()getProxy()final InputStreamgetResourceAsStream(String name) Get a resource from within this plugins jar or container.org.slf4j.LoggerbooleanReturns whenever this plugin is enabled.voidloadConfig(Class<? extends ConfigurationProvider> configType) (Re)loads a default config.voidCalled when this plugin is disabled.voidonEnable()Called when this plugin is enabled.voidonLoad()Called when the plugin has just been loaded.voidSaves the configuration changes (if have)
-
Constructor Details
-
Plugin
public Plugin() -
Plugin
-
-
Method Details
-
getSLF4JLogger
public org.slf4j.Logger getSLF4JLogger() -
onLoad
public void onLoad()Called when the plugin has just been loaded. Most of the proxy will not be initialized, so only use it for registeringConfigurationAdapter's and other predefined behavior. -
onEnable
public void onEnable()Called when this plugin is enabled. -
onDisable
public void onDisable()Called when this plugin is disabled. -
loadConfig
(Re)loads a default config.- Parameters:
configType- type of the config, whichshould be supported by default
-
getConfig
Gets the default configuration- Returns:
- configuration
- Throws:
IllegalArgumentException- if config not loaded
-
saveConfig
public void saveConfig()Saves the configuration changes (if have)- Throws:
IllegalArgumentException- if config not loaded
-
getDataFolder
Gets the data folder where this plugin may store arbitrary data. It will be a child ofProxyServer.getPluginsFolder().- Returns:
- the data folder of this plugin
-
getResourceAsStream
Get a resource from within this plugins jar or container. Care must be taken to close the returned stream.- Parameters:
name- the full path name of this resource- Returns:
- the stream for getting this resource, or null if it does not exist
-
isEnabled
public boolean isEnabled()Returns whenever this plugin is enabled.- Returns:
trueif enabled
-
getExecutorService
Deprecated. -
getDescription
-
getProxy
-
getFile
-
getLogger
-