87
paper-api/src/main/java/org/bukkit/plugin/PluginManager.java
Normal file
87
paper-api/src/main/java/org/bukkit/plugin/PluginManager.java
Normal file
@ -0,0 +1,87 @@
|
||||
|
||||
package org.bukkit.plugin;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public 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
|
||||
*/
|
||||
public Plugin[] loadPlugins(File directory);
|
||||
|
||||
/**
|
||||
* Calls a player related event with the given details
|
||||
*
|
||||
* @param type Type of player related event to call
|
||||
* @param event Event details
|
||||
*/
|
||||
public void callEvent(Event event);
|
||||
|
||||
/**
|
||||
* Registers the given event to the specified listener
|
||||
*
|
||||
* @param type EventType to register
|
||||
* @param listener Listener to register
|
||||
* @param priority Priority of this event
|
||||
* @param plugin Plugin to register
|
||||
*/
|
||||
public void registerEvent(Event.Type type, Listener listener, Priority priority, Plugin plugin);
|
||||
}
|
||||
Reference in New Issue
Block a user