Search in sources :

Example 1 with PluginLibraryHandler

use of me.staartvin.statz.hooks.handlers.PluginLibraryHandler in project Statz by Staartvin.

the class DependencyManager method isAvailable.

/**
 * Check whether a plugin is available using PluginLibrary.
 * @param library Library to check
 * @return true if it is available, false otherwise.
 */
public boolean isAvailable(Library library) {
    if (!this.isAvailable(StatzDependency.PLUGINLIBRARY))
        return false;
    if (library == null)
        return false;
    PluginLibraryHandler handler = (PluginLibraryHandler) getDependency(StatzDependency.PLUGINLIBRARY);
    if (handler == null) {
        return false;
    }
    LibraryHook hook = handler.getLibraryHook(library);
    if (hook == null) {
        return false;
    }
    return hook.isAvailable();
}
Also used : PluginLibraryHandler(me.staartvin.statz.hooks.handlers.PluginLibraryHandler) LibraryHook(me.staartvin.plugins.pluginlibrary.hooks.LibraryHook)

Aggregations

LibraryHook (me.staartvin.plugins.pluginlibrary.hooks.LibraryHook)1 PluginLibraryHandler (me.staartvin.statz.hooks.handlers.PluginLibraryHandler)1