Class EldoPlugin
- All Implemented Interfaces:
DebugDataProvider
,org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
,org.bukkit.plugin.Plugin
JavaPlugin
.
Provides basic function to wrap some stuff and make it easier to access
- Since:
- 1.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a list of classes which should be registered viaConfigurationSerialization.registerClass(Class)
.Get debug information for the current object instance.static EldoPlugin
abstract Level
final org.bukkit.plugin.PluginManager
Get the servers plugin manager.final org.bukkit.scheduler.BukkitScheduler
Get the servers scheduler.static Logger
logger()
final boolean
onCommand
(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.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, org.bukkit.command.TabExecutor tabExecutor) Register a tabexecutor for a command.final void
registerListener
(org.bukkit.event.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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
getLogger
in classorg.bukkit.plugin.java.JavaPlugin
-
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
public final void registerListener(org.bukkit.event.Listener... listener) 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
public final org.bukkit.plugin.PluginManager getPluginManager()Get the servers plugin manager.- Returns:
- plugin manager
-
getScheduler
public final org.bukkit.scheduler.BukkitScheduler getScheduler()Get the servers scheduler.- Returns:
- scheduler instance
-
getConfigSerialization
public List<Class<? extends org.bukkit.configuration.serialization.ConfigurationSerializable>> 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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.bukkit.plugin.java.JavaPlugin
-
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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
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 org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args) - Specified by:
onCommand
in interfaceorg.bukkit.command.CommandExecutor
- Overrides:
onCommand
in classorg.bukkit.plugin.java.JavaPlugin
-