public abstract class VelocityPlugin extends Object implements APFPlugin
IPlugin implementation for Velocity.
This class should be extended when creating a velocity part of your plugin using this library.
It provides instances for a PluginLogger, DebugLogger, ErrorHandler, Timings and RunnableFactory.
If you wish to change default debug or error handling behavior, use
IPlugin.setDebugLoggers(com.djrapitops.plugin.logging.debug.DebugLogger...)
IPlugin.setErrorHandlers(com.djrapitops.plugin.logging.error.ErrorHandler...)
for method overview.| Modifier and Type | Field and Description |
|---|---|
protected CombineDebugLogger |
debugLogger |
protected DefaultErrorHandler |
errorHandler |
protected PluginLogger |
logger |
protected com.velocitypowered.api.proxy.ProxyServer |
proxy |
protected boolean |
reloading |
protected RunnableFactory |
runnableFactory |
protected Timings |
timings |
| Constructor and Description |
|---|
VelocityPlugin(com.velocitypowered.api.proxy.ProxyServer proxy,
org.slf4j.Logger slf4jLogger,
Path dataFolderPath)
Standard constructor that initializes the plugin with the default DebugLogger.
|
VelocityPlugin(com.velocitypowered.api.proxy.ProxyServer proxy,
org.slf4j.Logger slf4jLogger,
Path dataFolderPath,
CombineDebugLogger debugLogger)
Constructor for defining a debug logger at creation time.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getDataFolder() |
DebugLogger |
getDebugLogger() |
ErrorHandler |
getErrorHandler() |
protected org.slf4j.Logger |
getLogger()
Implement this method by injecting slf4j.Logger in your plugin class.
|
PluginLogger |
getPluginLogger() |
com.velocitypowered.api.proxy.ProxyServer |
getProxy()
Implement this method by injecting ProxyServer in your plugin class.
|
RunnableFactory |
getRunnableFactory() |
Timings |
getTimings() |
String |
getVersion() |
boolean |
isReloading() |
void |
onDisable() |
void |
onReload() |
void |
registerCommand(String name,
CommandNode command) |
void |
registerListener(Object... listeners) |
void |
reloadPlugin(boolean full) |
void |
setDebugLoggers(DebugLogger... loggers) |
void |
setErrorHandlers(ErrorHandler... errorHandlers) |
void |
setReloading(boolean reloading) |
protected final com.velocitypowered.api.proxy.ProxyServer proxy
protected final PluginLogger logger
protected final CombineDebugLogger debugLogger
protected final DefaultErrorHandler errorHandler
protected final Timings timings
protected final RunnableFactory runnableFactory
protected boolean reloading
public VelocityPlugin(com.velocitypowered.api.proxy.ProxyServer proxy,
org.slf4j.Logger slf4jLogger,
Path dataFolderPath)
proxy - Injected ProxyServer.slf4jLogger - Injected Logger.dataFolderPath - Injected Path to the plugin data folder.public VelocityPlugin(com.velocitypowered.api.proxy.ProxyServer proxy,
org.slf4j.Logger slf4jLogger,
Path dataFolderPath,
CombineDebugLogger debugLogger)
proxy - Injected ProxyServer.slf4jLogger - Injected Logger.dataFolderPath - Injected Path to the plugin data folder.debugLogger - debug logger to use.public File getDataFolder()
getDataFolder in interface IPluginpublic com.velocitypowered.api.proxy.ProxyServer getProxy()
protected org.slf4j.Logger getLogger()
public void reloadPlugin(boolean full)
reloadPlugin in interface IPluginpublic void registerListener(Object... listeners)
public void registerCommand(String name, CommandNode command)
registerCommand in interface IPluginpublic String getVersion()
getVersion in interface IPluginpublic DebugLogger getDebugLogger()
getDebugLogger in interface IPluginpublic ErrorHandler getErrorHandler()
getErrorHandler in interface IPluginpublic Timings getTimings()
getTimings in interface IPluginpublic RunnableFactory getRunnableFactory()
getRunnableFactory in interface IPluginpublic PluginLogger getPluginLogger()
getPluginLogger in interface IPluginpublic boolean isReloading()
isReloading in interface IPluginpublic void setReloading(boolean reloading)
setReloading in interface APFPluginpublic void setDebugLoggers(DebugLogger... loggers)
setDebugLoggers in interface IPluginpublic void setErrorHandlers(ErrorHandler... errorHandlers)
setErrorHandlers in interface IPluginCopyright © 2018. All rights reserved.