Class BaseManager

java.lang.Object
dev.demeng.pluginbase.plugin.BaseManager

public final class BaseManager extends Object
A manager containing all other managers associated with the library, as well as the JavaPlugin the library is working with.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Thread
    Gets the main thread of the server that is using the plugin.
    static @NotNull org.bukkit.plugin.java.JavaPlugin
    Gets a never-null instance of the JavaPlugin the library is currently working with.
    static void
    setPlugin(org.bukkit.plugin.java.JavaPlugin newPlugin)
    Sets the JavaPlugin that the library is currently working with.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseManager

      public BaseManager()
  • Method Details

    • getPlugin

      @NotNull public static @NotNull org.bukkit.plugin.java.JavaPlugin getPlugin()
      Gets a never-null instance of the JavaPlugin the library is currently working with.
      Returns:
      The JavaPlugin the library is currently working with
      Throws:
      RuntimeException - If the plugin is not set
    • setPlugin

      public static void setPlugin(org.bukkit.plugin.java.JavaPlugin newPlugin)
      Sets the JavaPlugin that the library is currently working with.
      Parameters:
      newPlugin - The new instance of JavaPlugin.
    • getMainThread

      @NotNull public static @NotNull Thread getMainThread()
      Gets the main thread of the server that is using the plugin.
      Returns:
      The main thread