public class Plugin extends Object
Modifier | Constructor and Description |
---|---|
|
Plugin() |
protected |
Plugin(ProxyServer proxy,
PluginDescription description) |
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfig()
Gets the default configuration
|
File |
getDataFolder()
Gets the data folder where this plugin may store arbitrary data.
|
PluginDescription |
getDescription() |
ExecutorService |
getExecutorService()
Deprecated.
|
File |
getFile() |
Logger |
getLogger() |
ProxyServer |
getProxy() |
InputStream |
getResourceAsStream(String name)
Get a resource from within this plugins jar or container.
|
org.slf4j.Logger |
getSLF4JLogger() |
boolean |
isEnabled()
Returns whenever this plugin is enabled.
|
void |
loadConfig(Class<? extends ConfigurationProvider> configType)
(Re)loads a default config.
|
void |
onDisable()
Called when this plugin is disabled.
|
void |
onEnable()
Called when this plugin is enabled.
|
void |
onLoad()
Called when the plugin has just been loaded.
|
void |
saveConfig()
Saves the configuration changes (if have)
|
public Plugin()
protected Plugin(ProxyServer proxy, PluginDescription description)
public org.slf4j.Logger getSLF4JLogger()
public void onLoad()
ConfigurationAdapter
's and other predefined behavior.public void onEnable()
public void onDisable()
public void loadConfig(Class<? extends ConfigurationProvider> configType)
configType
- type of the config, which public Configuration getConfig()
IllegalArgumentException
- if config not loadedpublic void saveConfig()
IllegalArgumentException
- if config not loadedpublic final File getDataFolder()
ProxyServer.getPluginsFolder()
.public final InputStream getResourceAsStream(String name)
name
- the full path name of this resourcepublic boolean isEnabled()
true
if enabled@Deprecated public ExecutorService getExecutorService()
public PluginDescription getDescription()
public ProxyServer getProxy()
public File getFile()
public Logger getLogger()
Copyright © 2019–2022. All rights reserved.