Class LuxDialoguesAPI

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
org.aselstudios.luxdialoguesapi.LuxDialoguesAPI
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public abstract class LuxDialoguesAPI extends org.bukkit.plugin.java.JavaPlugin
Base plugin class for the LuxDialogues API.

Implement this in your Bukkit/Spigot/Paper plugin and call setInstance(LuxDialoguesAPI) and setProvider(DialogueProvider) during startup to make the API and provider available statically.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the registered API plugin instance.
    Gets the registered dialogue provider implementation.
    static void
    Sets the singleton API plugin instance.
    static void
    Registers the dialogue provider implementation.

    Methods inherited from class org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onDisable, onEnable, onLoad, 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
  • Constructor Details

    • LuxDialoguesAPI

      public LuxDialoguesAPI()
  • Method Details

    • setInstance

      public static void setInstance(LuxDialoguesAPI instance)
      Sets the singleton API plugin instance.
      Parameters:
      instance - concrete plugin implementation
      Throws:
      IllegalStateException - if the instance was already set
      NullPointerException - if instance is null
    • getAPI

      public static LuxDialoguesAPI getAPI()
      Gets the registered API plugin instance.
      Returns:
      current LuxDialoguesAPI instance, or null if not yet set
    • setProvider

      public static void setProvider(DialogueProvider p)
      Registers the dialogue provider implementation.
      Parameters:
      p - provider implementation used to send and manage dialogues
      Throws:
      IllegalStateException - if a provider was already set
    • getProvider

      public static DialogueProvider getProvider()
      Gets the registered dialogue provider implementation.
      Returns:
      current DialogueProvider
      Throws:
      IllegalStateException - if no provider has been set