Class 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.JavaPlugin
    An extendable class that adds utility to the core JavaPlugin class
    • Field Summary

      Fields 
      Modifier and Type Field Description
      LapisCoreConfiguration config
      The config management class is registered here so that it can be accessed mainly for message retrieval
      LapisCoreFileWatcher fileWatcher
      PLease store your LapisCoreFileWatcher here so that it can be stopped on disable
      LapisCorePermissions perms
      The permission management class is registered here so that it can be accessed throughout the plugin for checking permissions
      java.lang.String primaryColor
      The primary color pulled from the config
      java.lang.String secondaryColor
      The secondary color pulled from the config
      LapisTaskHandler tasks
      Please 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 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
      java.lang.ClassLoader getPluginClassLoader()
      Get the normally protected class loader from the JavaPlugin class
      void onDisable()  
      void registerConfiguration​(LapisCoreConfiguration config)
      Register a LapisCoreConfiguration class to be accessed with this.config
      void registerPermissions​(LapisCorePermissions perms)
      Register a LapisCorePermissions class 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, 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
    • 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
    • Constructor Detail

      • LapisCorePlugin

        public LapisCorePlugin()
        Used to register the instance of the plugin for static access, this is called by Bukkit when it loads the plugin
    • Method Detail

      • registerConfiguration

        public void registerConfiguration​(LapisCoreConfiguration config)
        Register a LapisCoreConfiguration class to be accessed with this.config
        Parameters:
        config - The configuration class you wish to register
      • registerPermissions

        public void registerPermissions​(LapisCorePermissions perms)
        Register a LapisCorePermissions class 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
      • onDisable

        public void onDisable()
        Specified by:
        onDisable in interface org.bukkit.plugin.Plugin
        Overrides:
        onDisable in class org.bukkit.plugin.java.JavaPlugin