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 -
Method Summary
Modifier and TypeMethodDescriptionstatic LuxDialoguesAPIgetAPI()Gets the registered API plugin instance.static DialogueProviderGets the registered dialogue provider implementation.static voidsetInstance(LuxDialoguesAPI instance) Sets the singleton API plugin instance.static voidRegisters 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, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
-
Constructor Details
-
LuxDialoguesAPI
public LuxDialoguesAPI()
-
-
Method Details
-
setInstance
Sets the singleton API plugin instance.- Parameters:
instance- concrete plugin implementation- Throws:
IllegalStateException- if the instance was already setNullPointerException- ifinstanceisnull
-
getAPI
Gets the registered API plugin instance.- Returns:
- current
LuxDialoguesAPIinstance, ornullif not yet set
-
setProvider
Registers the dialogue provider implementation.- Parameters:
p- provider implementation used to send and manage dialogues- Throws:
IllegalStateException- if a provider was already set
-
getProvider
Gets the registered dialogue provider implementation.- Returns:
- current
DialogueProvider - Throws:
IllegalStateException- if no provider has been set
-