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 EldoPluginabstract Levelfinal org.bukkit.plugin.PluginManagerGet the servers plugin manager.final org.bukkit.scheduler.BukkitSchedulerGet the servers scheduler.static Loggerlogger()final booleanonCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) final voidfinal voidonEnable()final voidonLoad()voidCalled when this plugin is disabled.voidCalled when this plugin is enabled.voidonPluginEnable(boolean reload) Called when this plugin is enabled.voidExecuted on load of the plugin.voidExecuted on when the plugin gets reloaded via server reload.voidCalled when the server has started completely.voidonPostStart(boolean reload) Called when the server has started completely.final voidregisterCommand(AdvancedCommand command) Register a advanced command.final voidregisterCommand(String command, AdvancedCommand executor) Register a tabexecutor for a command.final voidregisterCommand(String command, org.bukkit.command.TabExecutor tabExecutor) Register a tabexecutor for a command.final voidregisterListener(org.bukkit.event.Listener... listener) Registers listener for the pluginfinal intscheduleRepeatingTask(Runnable task, int period) Schedules a repeating task.final intscheduleRepeatingTask(Runnable task, int delay, int period) Schedules a repeating task.protected final voidMethods 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, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.eldoria.eldoutilities.debug.DebugDataProvider
getDebugProviders
-
Constructor Details
-
EldoPlugin
public EldoPlugin() -
EldoPlugin
-
-
Method Details
-
getInstance
-
logger
-
getLogger
- Specified by:
getLoggerin interfaceorg.bukkit.plugin.Plugin- Overrides:
getLoggerin 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:
onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
onLoadin 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:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein 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:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
onPluginDisable
Called when this plugin is disabled.- Throws:
Throwable- any exception
-
getDebugInformations
Description copied from interface:DebugDataProviderGet debug information for the current object instance.- Specified by:
getDebugInformationsin 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:
onCommandin interfaceorg.bukkit.command.CommandExecutor- Overrides:
onCommandin classorg.bukkit.plugin.java.JavaPlugin
-