Class EldoPlugin

All Implemented Interfaces:
DebugDataProvider, CommandExecutor, TabCompleter, TabExecutor, Plugin

public abstract class EldoPlugin extends JavaPlugin implements DebugDataProvider
Basic Plugin implementation of a JavaPlugin.

Provides basic function to wrap some stuff and make it easier to access

Since:
1.1.0
  • Constructor Details

  • Method Details

    • getInstance

      public static EldoPlugin getInstance()
    • logger

      public static Logger logger()
    • getLogger

      @NotNull public @NotNull Logger getLogger()
      Specified by:
      getLogger in interface Plugin
      Overrides:
      getLogger in class JavaPlugin
    • setLoggerLevel

      protected final void setLoggerLevel()
    • getLogLevel

      public abstract Level getLogLevel()
    • registerCommand

      public final void registerCommand(String command, TabExecutor tabExecutor)
      Register a tabexecutor for a command.

      This tabexecutor will handle execution and tab completion.

      Parameters:
      command - name of command
      tabExecutor - command executor
    • registerCommand

      public final void registerCommand(AdvancedCommand command)
      Register a advanced command.

      This will register a command exector for the toplevel command.

      Parameters:
      command - command
    • registerCommand

      public final void registerCommand(String command, AdvancedCommand executor)
      Register a tabexecutor for a command.

      This tabexecutor will handle execution and tab completion.

      Parameters:
      command - name of command
      executor - command executor
    • registerListener

      public final void registerListener(Listener... listener)
      Registers listener for the plugin
      Parameters:
      listener - listener to register
    • scheduleRepeatingTask

      public final int scheduleRepeatingTask(Runnable task, int period)
      Schedules a repeating task.

      This task will be executed by the main server thread.

      Parameters:
      task - Task to be executed
      period - Period in server ticks of the task
      Returns:
      Task id number (-1 if scheduling failed)
    • scheduleRepeatingTask

      public final int scheduleRepeatingTask(Runnable task, int delay, int period)
      Schedules a repeating task.

      This task will be executed by the main server thread.

      Parameters:
      task - Task to be executed
      delay - Delay in server ticks before executing first repeat
      period - Period in server ticks of the task
      Returns:
      Task id number (-1 if scheduling failed)
    • getPluginManager

      public final PluginManager getPluginManager()
      Get the servers plugin manager.
      Returns:
      plugin manager
    • getScheduler

      public final BukkitScheduler getScheduler()
      Get the servers scheduler.
      Returns:
      scheduler instance
    • getConfigSerialization

      public List<Class<? extends ConfigurationSerializable>> getConfigSerialization()
      Get a list of classes which should be registered via ConfigurationSerialization.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 interface Plugin
      Overrides:
      onLoad in class JavaPlugin
    • onPluginLoad

      public void onPluginLoad() throws Throwable
      Executed on load of the plugin. Replacement for Plugin.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 interface Plugin
      Overrides:
      onEnable in class JavaPlugin
    • onPluginReload

      public void onPluginReload() throws Throwable
      Executed on when the plugin gets reloaded via server reload. This method will be executed before execution of onPluginEnable().

      Any thrown exception will be catched and make the plugin initializing the failsave mode.

      Throws:
      Throwable - any throwable
    • onPostStart

      public void onPostStart(boolean reload) throws Throwable
      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

      public void onPostStart() throws Throwable
      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

      public void onPluginEnable(boolean reload) throws Throwable
      Called when this plugin is enabled. Replacement for Plugin.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

      public void onPluginEnable() throws Throwable
      Called when this plugin is enabled. Replacement for Plugin.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 interface Plugin
      Overrides:
      onDisable in class JavaPlugin
    • onPluginDisable

      public void onPluginDisable() throws Throwable
      Called when this plugin is disabled.
      Throws:
      Throwable - any exception
    • getDebugInformations

      @NotNull public @NotNull EntryData[] getDebugInformations()
      Description copied from interface: DebugDataProvider
      Get debug information for the current object instance.
      Specified by:
      getDebugInformations in interface DebugDataProvider
      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 interface CommandExecutor
      Overrides:
      onCommand in class JavaPlugin