Package net.lapismc.lapiscore
Class LapisCorePlugin
- java.lang.Object
-
- org.bukkit.plugin.PluginBase
-
- org.bukkit.plugin.java.JavaPlugin
-
- net.lapismc.lapiscore.LapisCorePlugin
-
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public class LapisCorePlugin extends org.bukkit.plugin.java.JavaPluginAn extendable class that adds utility to the core JavaPlugin class
-
-
Field Summary
Fields Modifier and Type Field Description LapisCoreConfigurationconfigThe config management class is registered here so that it can be accessed mainly for message retrievalLapisCoreFileWatcherfileWatcherPLease store your LapisCoreFileWatcher here so that it can be stopped on disableLapisCorePermissionspermsThe permission management class is registered here so that it can be accessed throughout the plugin for checking permissionsjava.lang.StringprimaryColorThe primary color pulled from the configjava.lang.StringsecondaryColorThe secondary color pulled from the configLapisTaskHandlertasksPlease use this object to store tasks since it means stopping them all is so easy
-
Constructor Summary
Constructors Constructor Description LapisCorePlugin()Used to register the instance of the plugin for static access, this is called by Bukkit when it loads the plugin
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LapisCorePlugingetInstance()Get the main instance of this class for use in Bukkit methods in places where dependency injection isn't viable Should only be used when 100% necessary, don't use this if you can get a normal reference to the main class in some wayjava.lang.ClassLoadergetPluginClassLoader()Get the normally protected class loader from the JavaPlugin classvoidonDisable()A default onDisable to stop all tasks and send a success message, can be called with using super key wordvoidonEnable()A default onEnable to send a success message, can be called with using super key wordvoidregisterConfiguration(LapisCoreConfiguration config)Register aLapisCoreConfigurationclass to be accessed with this.configvoidregisterPermissions(LapisCorePermissions perms)Register aLapisCorePermissionsclass to be accessed with this.perms-
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
-
-
-
-
Field Detail
-
primaryColor
public java.lang.String primaryColor
The primary color pulled from the config
-
secondaryColor
public java.lang.String secondaryColor
The secondary color pulled from the config
-
config
public LapisCoreConfiguration config
The config management class is registered here so that it can be accessed mainly for message retrieval
-
perms
public LapisCorePermissions perms
The permission management class is registered here so that it can be accessed throughout the plugin for checking permissions
-
fileWatcher
public LapisCoreFileWatcher fileWatcher
PLease store your LapisCoreFileWatcher here so that it can be stopped on disable
-
tasks
public LapisTaskHandler tasks
Please use this object to store tasks since it means stopping them all is so easy
-
-
Method Detail
-
registerConfiguration
public void registerConfiguration(LapisCoreConfiguration config)
Register aLapisCoreConfigurationclass to be accessed with this.config- Parameters:
config- The configuration class you wish to register
-
registerPermissions
public void registerPermissions(LapisCorePermissions perms)
Register aLapisCorePermissionsclass to be accessed with this.perms- Parameters:
perms- The permissions class you wish to register
-
getPluginClassLoader
public java.lang.ClassLoader getPluginClassLoader()
Get the normally protected class loader from the JavaPlugin class- Returns:
- Returns this plugins class loader
-
getInstance
public static LapisCorePlugin getInstance()
Get the main instance of this class for use in Bukkit methods in places where dependency injection isn't viable Should only be used when 100% necessary, don't use this if you can get a normal reference to the main class in some way- Returns:
- The instance of
LapisCorePlugin
-
onEnable
public void onEnable()
A default onEnable to send a success message, can be called with using super key word- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()
A default onDisable to stop all tasks and send a success message, can be called with using super key word- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
-