Class EldoPlugin
- All Implemented Interfaces:
DebugDataProvider
,CommandExecutor
,TabCompleter
,TabExecutor
,Plugin
JavaPlugin
.
Provides basic function to wrap some stuff and make it easier to access
- Since:
- 1.1.0
-
Constructor Summary
ConstructorDescriptionEldoPlugin
(@NotNull JavaPluginLoader loader, @NotNull PluginDescriptionFile description, @NotNull File dataFolder, @NotNull File file) -
Method Summary
Modifier and TypeMethodDescriptionList<Class<? extends ConfigurationSerializable>>
Get a list of classes which should be registered viaConfigurationSerialization.registerClass(Class)
.Get debug information for the current object instance.static EldoPlugin
abstract Level
final PluginManager
Get the servers plugin manager.final BukkitScheduler
Get the servers scheduler.static Logger
logger()
final boolean
onCommand
(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) final void
final void
onEnable()
final void
onLoad()
void
Called when this plugin is disabled.void
Called when this plugin is enabled.void
onPluginEnable
(boolean reload) Called when this plugin is enabled.void
Executed on load of the plugin.void
Executed on when the plugin gets reloaded via server reload.void
Called when the server has started completely.void
onPostStart
(boolean reload) Called when the server has started completely.final void
registerCommand
(AdvancedCommand command) Register a advanced command.final void
registerCommand
(String command, AdvancedCommand executor) Register a tabexecutor for a command.final void
registerCommand
(String command, TabExecutor tabExecutor) Register a tabexecutor for a command.final void
registerListener
(Listener... listener) Registers listener for the pluginfinal int
scheduleRepeatingTask
(Runnable task, int period) Schedules a repeating task.final int
scheduleRepeatingTask
(Runnable task, int delay, int period) Schedules a repeating task.protected final void
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
Methods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.eldoria.eldoutilities.debug.DebugDataProvider
getDebugProviders
-
Constructor Details
-
EldoPlugin
public EldoPlugin() -
EldoPlugin
-
-
Method Details
-
getInstance
-
logger
-
getLogger
- Specified by:
getLogger
in interfacePlugin
- Overrides:
getLogger
in classJavaPlugin
-
setLoggerLevel
protected final void setLoggerLevel() -
getLogLevel
-
registerCommand
Register a tabexecutor for a command.This tabexecutor will handle execution and tab completion.
- Parameters:
command
- name of commandtabExecutor
- command executor
-
registerCommand
Register a advanced command.This will register a command exector for the toplevel command.
- Parameters:
command
- command
-
registerCommand
Register a tabexecutor for a command.This tabexecutor will handle execution and tab completion.
- Parameters:
command
- name of commandexecutor
- command executor
-
registerListener
Registers listener for the plugin- Parameters:
listener
- listener to register
-
scheduleRepeatingTask
Schedules a repeating task.This task will be executed by the main server thread.
- Parameters:
task
- Task to be executedperiod
- Period in server ticks of the task- Returns:
- Task id number (-1 if scheduling failed)
-
scheduleRepeatingTask
Schedules a repeating task.This task will be executed by the main server thread.
- Parameters:
task
- Task to be executeddelay
- Delay in server ticks before executing first repeatperiod
- Period in server ticks of the task- Returns:
- Task id number (-1 if scheduling failed)
-
getPluginManager
Get the servers plugin manager.- Returns:
- plugin manager
-
getScheduler
Get the servers scheduler.- Returns:
- scheduler instance
-
getConfigSerialization
Get a list of classes which should be registered viaConfigurationSerialization.registerClass(Class)
.These classes will be registered on load plugin initialization.
- Returns:
- list of serializable classes.
-
onLoad
public final void onLoad()- Specified by:
onLoad
in interfacePlugin
- Overrides:
onLoad
in classJavaPlugin
-
onPluginLoad
Executed on load of the plugin. Replacement forPlugin.onLoad()
.Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Throws:
Throwable
- any throwable
-
onEnable
public final void onEnable()- Specified by:
onEnable
in interfacePlugin
- Overrides:
onEnable
in classJavaPlugin
-
onPluginReload
Executed on when the plugin gets reloaded via server reload. This method will be executed before execution ofonPluginEnable()
.Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Throws:
Throwable
- any throwable
-
onPostStart
Called when the server has started completely.Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Parameters:
reload
- indicated that the call was caused by a server reload- Throws:
Throwable
- any throwable
-
onPostStart
Called when the server has started completely.Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Throws:
Throwable
- any throwable
-
onPluginEnable
Called when this plugin is enabled. Replacement forPlugin.onEnable()
Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Parameters:
reload
- indicated that the call was caused by a server reload- Throws:
Throwable
- any throwable
-
onPluginEnable
Called when this plugin is enabled. Replacement forPlugin.onEnable()
Any thrown exception will be catched and make the plugin initializing the failsave mode.
- Throws:
Throwable
- any throwable
-
onDisable
public final void onDisable()- Specified by:
onDisable
in interfacePlugin
- Overrides:
onDisable
in classJavaPlugin
-
onPluginDisable
Called when this plugin is disabled.- Throws:
Throwable
- any exception
-
getDebugInformations
Description copied from interface:DebugDataProvider
Get debug information for the current object instance.- Specified by:
getDebugInformations
in interfaceDebugDataProvider
- Returns:
- array of entry data.
-
onCommand
public final boolean onCommand(@NotNull @NotNull CommandSender sender, @NotNull @NotNull Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args) - Specified by:
onCommand
in interfaceCommandExecutor
- Overrides:
onCommand
in classJavaPlugin
-