Class SimplePlugin

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
me.hsgamer.hscore.bukkit.simpleplugin.SimplePlugin
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public class SimplePlugin extends org.bukkit.plugin.java.JavaPlugin
A convenient JavaPlugin implementation
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDisableFunction(Runnable disableFunction)
    Add a function that will be called when the plugin is disabled.
    void
    Add a runnable that will be called after enabling the plugin
    void
    Execute when disabling the plugin
    void
    Execute when enabling the plugin
    <T> Collection<org.bukkit.plugin.RegisteredServiceProvider<T>>
    getAllProviders(Class<T> service)
    Get all providers of the service
    <T> org.bukkit.plugin.RegisteredServiceProvider<T>
    getProvider(Class<T> service)
    Get the registered provider of the service
    void
    Execute when loading the plugin
    <T> T
    loadProvider(Class<T> service)
    Load the provider of the service
    void
     
    void
     
    void
     
    void
    Execute after disabling all tasks, listeners and commands
    void
    Execute after enabling all plugins
    void
    Execute on the constructor
    void
    registerListener(org.bukkit.event.Listener listener)
    Register the listener
    <T> void
    registerProvider(Class<T> service, T provider)
    Register a provider for the service in the normal priority
    <T> void
    registerProvider(Class<T> service, T provider, org.bukkit.plugin.ServicePriority priority)
    Register a provider for the service

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

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, 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

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getLog4JLogger, getSLF4JLogger
  • Constructor Details

    • SimplePlugin

      public SimplePlugin()
  • Method Details

    • onLoad

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

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

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

      public void preLoad()
      Execute on the constructor
    • load

      public void load()
      Execute when loading the plugin
    • enable

      public void enable()
      Execute when enabling the plugin
    • postEnable

      public void postEnable()
      Execute after enabling all plugins
    • disable

      public void disable()
      Execute when disabling the plugin
    • postDisable

      public void postDisable()
      Execute after disabling all tasks, listeners and commands
    • registerListener

      public void registerListener(org.bukkit.event.Listener listener)
      Register the listener
      Parameters:
      listener - the listener
    • registerProvider

      public <T> void registerProvider(Class<T> service, T provider, org.bukkit.plugin.ServicePriority priority)
      Register a provider for the service
      Type Parameters:
      T - the type of the service
      Parameters:
      service - the service
      provider - the provider
      priority - the priority of the provider
    • registerProvider

      public <T> void registerProvider(Class<T> service, T provider)
      Register a provider for the service in the normal priority
      Type Parameters:
      T - the type of the service
      Parameters:
      service - the service
      provider - the provider
    • loadProvider

      public <T> T loadProvider(Class<T> service)
      Load the provider of the service
      Type Parameters:
      T - the type of the service
      Parameters:
      service - the service
      Returns:
      the provider
    • getProvider

      public <T> org.bukkit.plugin.RegisteredServiceProvider<T> getProvider(Class<T> service)
      Get the registered provider of the service
      Type Parameters:
      T - the type of the service
      Parameters:
      service - the service
      Returns:
      the provider
    • getAllProviders

      public <T> Collection<org.bukkit.plugin.RegisteredServiceProvider<T>> getAllProviders(Class<T> service)
      Get all providers of the service
      Type Parameters:
      T - the type of the service
      Parameters:
      service - the service
      Returns:
      the collection of providers
    • addDisableFunction

      public void addDisableFunction(Runnable disableFunction)
      Add a function that will be called when the plugin is disabled. When the plugin is disabled, the added functions will be called and then removed from the list.
      Parameters:
      disableFunction - the disable function
    • addPostEnableRunnable

      public void addPostEnableRunnable(Runnable runnable)
      Add a runnable that will be called after enabling the plugin
      Parameters:
      runnable - the runnable