mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
66 lines
1.9 KiB
Java
66 lines
1.9 KiB
Java
|
|
package org.bukkit.plugin;
|
|
|
|
import java.io.File;
|
|
|
|
/**
|
|
* Handles all plugin management from the Server
|
|
*/
|
|
public interface PluginManager {
|
|
|
|
/**
|
|
* Registers the specified plugin loader
|
|
*
|
|
* @param loader Class name of the PluginLoader to register
|
|
* @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader
|
|
*/
|
|
void RegisterInterface(Class loader) throws IllegalArgumentException;
|
|
|
|
/**
|
|
* Checks if the given plugin is loaded and returns it when applicable
|
|
*
|
|
* Please note that the name of the plugin is case-sensitive
|
|
*
|
|
* @param name Name of the plugin to check
|
|
* @return Plugin if it exists, otherwise null
|
|
*/
|
|
Plugin getPlugin(String name);
|
|
|
|
/**
|
|
* Checks if the given plugin is enabled or not
|
|
*
|
|
* Please note that the name of the plugin is case-sensitive.
|
|
*
|
|
* @param name Name of the plugin to check
|
|
* @return true if the plugin is enabled, otherwise false
|
|
*/
|
|
boolean isPluginEnabled(String name);
|
|
|
|
/**
|
|
* Checks if the given plugin is enabled or not
|
|
*
|
|
* @param plugin Plugin to check
|
|
* @return true if the plugin is enabled, otherwise false
|
|
*/
|
|
boolean isPluginEnabled(Plugin plugin);
|
|
|
|
/**
|
|
* Loads the plugin in the specified file
|
|
*
|
|
* File must be valid according to the current enabled Plugin interfaces
|
|
*
|
|
* @param file File containing the plugin to load
|
|
* @return The Plugin loaded, or null if it was invalid
|
|
* @throws InvalidPluginException Thrown when the specified file is not a valid plugin
|
|
*/
|
|
Plugin loadPlugin(File file) throws InvalidPluginException;
|
|
|
|
/**
|
|
* Loads the plugins contained within the specified directory
|
|
*
|
|
* @param directory Directory to check for plugins
|
|
* @return A list of all plugins loaded
|
|
*/
|
|
Plugin[] loadPlugins(File directory);
|
|
}
|