getPlugin

public static T getPlugin<T extends JavaPlugin>(Class<T> clazz)

This method provides fast access to the plugin that has provided the given plugin class, which is usually the plugin that implemented it.

An exception to this would be if plugin's jar that contained the class does not extend the class, where the intended plugin would have resided in getClassById different jar / classloader.

Return

the plugin that provides and implements said class

Parameters

<T>

getClassById class that extends JavaPlugin

clazz

the class desired

Throws

if clazz does not extend

if called from the static initializer for given JavaPlugin

if plugin that provided the class does not extend the class